From 8a65b582fdd24c15f45b2ef87c49e14ee434649a Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 22 Nov 2022 10:26:41 -0500 Subject: [PATCH 01/40] ci(showcase): add showcase IT coverage --- .github/workflows/ci.yaml | 2 -- .github/workflows/sonar.yaml | 54 +++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 14724cebea..8d18cba83b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -153,7 +153,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y curl unzip - - name: Install showcase run: | sudo mkdir -p /usr/src/showcase @@ -163,6 +162,5 @@ jobs: tar -xf showcase-* ./gapic-showcase run & cd - - - name: Showcase Integration Testing run: bazel --batch test //test/showcase/... diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index e14ba32fa2..e2d1297755 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -1,10 +1,15 @@ name: SonarCloud Build + on: push: branches: - main pull_request: types: [ opened, synchronize, reopened ] + +env: + SHOWCASE_VERSION: 0.25.0 + jobs: build: name: Build @@ -13,25 +18,72 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 uses: actions/setup-java@v3 with: java-version: 11 distribution: temurin + - run: java -version + + - name: Bazel File Cache Setup + id: cache-bazel + uses: actions/cache@v3 + with: + path: ~/.cache/bazel + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }} + - name: Bazel Cache Not Found + if: steps.cache-bazel.outputs.cache-hit != 'true' + run: | + echo "No cache found." + - name: Bazel Cache Found + if: steps.cache-bazel.outputs.cache-hit == 'true' + run: | + echo -n "Cache found. Cache size: " + du -sh ~/.cache/bazel + echo "If the cache seems broken, update the CACHE_VERSION secret in" + echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions" + echo "(use any random string, any GUID will work)" + echo "and it will start over with a clean cache." + echo "The old one will disappear after 7 days." + - name: Cache SonarCloud packages uses: actions/cache@v3 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar + + - name: Install system dependencies. + run: | + sudo apt-get update + sudo apt-get install -y curl unzip + - name: Install showcase + run: | + sudo mkdir -p /usr/src/showcase + sudo chown -R ${USER} /usr/src/ + curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz + cd /usr/src/showcase/ + tar -xf showcase-* + ./gapic-showcase run & + cd - + - name: Showcase Integration Testing + run: bazel --batch coverage //test/showcase/... + - name: Cache Maven packages uses: actions/cache@v3 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=googleapis_gapic-generator-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io + run: | + mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.projectKey=googleapis_gapic-generator-java \ + -Dsonar.organization=googleapis \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.javascript.lcov.reportPath=$(bazel info output_path)/_coverage/_coverage_report.dat From 830130fb70671d9bf9b557d6d95858a2430d564d Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 22 Nov 2022 14:10:28 -0500 Subject: [PATCH 02/40] ci(showcase): rework showcase coverage for combined report --- .github/workflows/sonar.yaml | 4 +- test/integration/BUILD.bazel | 40 +++++++++++++++++++ .../com/google/showcase/v1beta1/BUILD.bazel | 28 +++++-------- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index e2d1297755..92526696fd 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -67,8 +67,8 @@ jobs: tar -xf showcase-* ./gapic-showcase run & cd - - - name: Showcase Integration Testing - run: bazel --batch coverage //test/showcase/... + - name: Bazel Coverage + run: bazel --batch coverage //... --combined_report=lcov - name: Cache Maven packages uses: actions/cache@v3 diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel index a79cc24124..eef719f35e 100644 --- a/test/integration/BUILD.bazel +++ b/test/integration/BUILD.bazel @@ -7,6 +7,8 @@ load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") load("@rules_gapic//:gapic.bzl", "proto_library_with_info") load("@rules_proto//proto:defs.bzl", "proto_library") +package(default_visibility = ["//visibility:public"]) + #################################################### # Integration Test Rules #################################################### @@ -269,3 +271,41 @@ java_gapic_test( ], runtime_deps = [":pubsub_java_gapic_test"], ) + +SHOWCASE_DEPS = [ + "//test/showcase:showcase_java_grpc", + "//test/showcase:showcase_java_proto", + "@com_google_api_api_common//jar", + "@com_google_api_gax_java//gax-grpc:gax_grpc", + "@com_google_api_gax_java//gax-grpc:gax_grpc_testlib", + "@com_google_api_gax_java//gax-httpjson:gax_httpjson", + "@com_google_api_gax_java//gax-httpjson:gax_httpjson_testlib", + "@com_google_api_gax_java//gax:gax", + "@com_google_api_gax_java//gax:gax_testlib", + "@com_google_auth_google_auth_library_credentials//jar", + "@com_google_auth_google_auth_library_oauth2_http//jar", + "@com_google_code_findbugs_jsr305//jar", + "@com_google_code_gson_gson//jar", + "@com_google_googleapis//google/longrunning:longrunning_java_proto", + "@com_google_googleapis//google/rpc:rpc_java_proto", + "@com_google_googleapis//google/type:type_java_proto", + "@com_google_guava_guava//jar", + "@com_google_http_client_google_http_client//jar", + "@com_google_protobuf//:protobuf_java", + "@io_grpc_grpc_java//auth:auth", + "@io_grpc_grpc_java//core:core", + "@io_grpc_grpc_java//protobuf:protobuf", + "@io_grpc_grpc_java//stub:stub", + "@io_grpc_grpc_netty_shaded//jar", + "@io_opencensus_opencensus_api//jar", + "@io_opencensus_opencensus_contrib_grpc_metrics//jar", + "@javax_annotation_javax_annotation_api//jar", + "@junit_junit//jar", + "@org_threeten_threetenbp//jar", +] + +java_library( + name = "generated_showcase", + srcs = glob(["goldens/showcase/src/**/*.java"]), + deps = SHOWCASE_DEPS, +) diff --git a/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel b/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel index bb728daae9..f66a8debee 100644 --- a/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel +++ b/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel @@ -10,26 +10,21 @@ java_library( name = "showcase_tests", srcs = glob(["*.java"]), deps = [ - # Common - "//test/showcase:showcase_java_gapic", + "//test/integration:generated_showcase", "//test/showcase:showcase_java_proto", - "@com_google_api_api_common//:com_google_api_api_common", + "@com_google_api_api_common", "@com_google_api_gax_java//gax", + "@com_google_api_gax_java//gax-grpc:gax_grpc", "@com_google_code_gson_gson//jar", "@com_google_googleapis//google/type:type_java_proto", - "@io_grpc_grpc_java//core:core", - "@io_grpc_grpc_java//protobuf:protobuf", - "@junit_junit//jar", - ] + [ - # gRPC-specific - "@com_google_api_gax_java//gax-grpc:gax_grpc", - "@io_grpc_grpc_java//auth:auth", - "@io_grpc_grpc_java//stub:stub", + "@com_google_http_client_google_http_client", + "@io_grpc_grpc_java//auth", + "@io_grpc_grpc_java//core", + "@io_grpc_grpc_java//protobuf", + "@io_grpc_grpc_java//stub", "@io_grpc_grpc_netty_shaded//jar", "@io_opencensus_opencensus_contrib_grpc_metrics//jar", - ] + [ - # REST-specific - "@com_google_http_client_google_http_client", + "@junit_junit//jar", ], ) @@ -41,8 +36,5 @@ java_gapic_test( "com.google.showcase.v1beta1.FirstRpcIT", "com.google.showcase.v1beta1.NumericEnumsIT", ], - runtime_deps = [ - ":showcase_tests", - "//test/showcase:showcase_java_gapic_test", - ], + runtime_deps = [":showcase_tests"], ) From eed1de7711cf40e187a400436c68c8040e71b31c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 28 Nov 2022 18:04:24 +0100 Subject: [PATCH 03/40] chore(deps): update dependency gradle to v7.6 (#1101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [gradle](https://gradle.org) ([source](https://togithub.com/gradle/gradle)) | minor | `7.5.1` -> `7.6` | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java). --- .../resources/gradle/gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties b/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties index ae04661ee7..070cb702f0 100644 --- a/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From fa32e9f74ca3eb8cdd5b353a467db7036dee0082 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 28 Nov 2022 12:07:37 -0500 Subject: [PATCH 04/40] ci(showcase): debug showcase integration coverage report in sonar --- .github/workflows/sonar.yaml | 1 + pom.xml | 39 +++++++++++++++++++++++++++++++++++- test/BUILD.bazel | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 test/BUILD.bazel diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 92526696fd..efed12d830 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -83,6 +83,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.verbose=true \ -Dsonar.projectKey=googleapis_gapic-generator-java \ -Dsonar.organization=googleapis \ -Dsonar.host.url=https://sonarcloud.io \ diff --git a/pom.xml b/pom.xml index f38b35a476..b1f6e03b1f 100644 --- a/pom.xml +++ b/pom.xml @@ -10,6 +10,7 @@ UTF-8 44d6bef0ca6db8bba3fb324c8186e694bcc4829c + 0.8.8 @@ -24,6 +25,42 @@ + + + + showcase + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + perform-showcase-integration-tests + + exec + + integration-test + + bazel + + coverage + + + + //test/... + --combined_report=lcov + + + + + + + + + + @@ -256,7 +293,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + ${jacoco.version} diff --git a/test/BUILD.bazel b/test/BUILD.bazel new file mode 100644 index 0000000000..ffd0fb0cdc --- /dev/null +++ b/test/BUILD.bazel @@ -0,0 +1 @@ +package(default_visibility = ["//visibility:public"]) From c58a3356b999339a6962c7298dfd447450ef70a3 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 28 Nov 2022 12:23:10 -0500 Subject: [PATCH 05/40] ci(showcase): remove duplicate bazel coverage stage --- .github/workflows/sonar.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index efed12d830..13bb1f0a5e 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -67,8 +67,6 @@ jobs: tar -xf showcase-* ./gapic-showcase run & cd - - - name: Bazel Coverage - run: bazel --batch coverage //... --combined_report=lcov - name: Cache Maven packages uses: actions/cache@v3 From c52f041c88db355c73ef14877171b61d07b99d5c Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 28 Nov 2022 13:49:57 -0500 Subject: [PATCH 06/40] ci(showcase): invoke sonar after integration tests --- .github/workflows/sonar.yaml | 4 +++- pom.xml | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 13bb1f0a5e..4f76973b08 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -80,7 +80,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + mvn verify \ + -P showcase,sonar \ + -B \ -Dsonar.verbose=true \ -Dsonar.projectKey=googleapis_gapic-generator-java \ -Dsonar.organization=googleapis \ diff --git a/pom.xml b/pom.xml index b1f6e03b1f..ad4f2a4160 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ //test/... --combined_report=lcov + --test_verbose_timeout_warnings @@ -59,6 +60,26 @@ + + sonar + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.9.1.2184 + + + verify + + sonar + + + + + + + From f990fa6a1d529578da5b8c30fce29ea3aede056d Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 28 Nov 2022 15:45:12 -0500 Subject: [PATCH 07/40] ci(showcase): debug with maven and sonar --- .github/workflows/sonar.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 4f76973b08..45457b68ea 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -83,6 +83,7 @@ jobs: mvn verify \ -P showcase,sonar \ -B \ + -X \ -Dsonar.verbose=true \ -Dsonar.projectKey=googleapis_gapic-generator-java \ -Dsonar.organization=googleapis \ From 3a800319afc5fc09c9c2c1257a2a1cf6fe953426 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 28 Nov 2022 16:24:25 -0500 Subject: [PATCH 08/40] ci(showcase): attempt sonar workaround for lcov coverage parsing --- src/main/js/sonar-workaround.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/main/js/sonar-workaround.js diff --git a/src/main/js/sonar-workaround.js b/src/main/js/sonar-workaround.js new file mode 100644 index 0000000000..9b69adf250 --- /dev/null +++ b/src/main/js/sonar-workaround.js @@ -0,0 +1,4 @@ +// This file has been added to enable the 'JavaScript/TypeScript Coverage' feature of Sonar. +// Integration test coverage is generated by Bazel in lcov format, which is not supported by the +// Java Sonar sensor. Instead, we use the JS/TS scanner to parse this coverage, as it does support +// lcov. From 6eebc706ed182f433dbaa365ab3f4ce34e1909e3 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 29 Nov 2022 16:26:56 -0500 Subject: [PATCH 09/40] chore(showcase): create maven showcase module --- .gitignore | 1 + showcase/BUILD.bazel | 107 + showcase/gapic-showcase/pom.xml | 186 ++ .../showcase/v1beta1/ComplianceClient.java | 946 ++++++++ .../showcase/v1beta1/ComplianceSettings.java | 297 +++ .../google/showcase/v1beta1/EchoClient.java | 999 ++++++++ .../google/showcase/v1beta1/EchoSettings.java | 315 +++ .../showcase/v1beta1/IdentityClient.java | 774 ++++++ .../showcase/v1beta1/IdentitySettings.java | 251 ++ .../showcase/v1beta1/MessagingClient.java | 2117 +++++++++++++++++ .../showcase/v1beta1/MessagingSettings.java | 364 +++ .../v1beta1/SequenceServiceClient.java | 498 ++++ .../v1beta1/SequenceServiceSettings.java | 229 ++ .../showcase/v1beta1/TestingClient.java | 880 +++++++ .../showcase/v1beta1/TestingSettings.java | 286 +++ .../showcase/v1beta1/gapic_metadata.json | 210 ++ .../google/showcase/v1beta1/package-info.java | 162 ++ .../showcase/v1beta1/stub/ComplianceStub.java | 81 + .../v1beta1/stub/ComplianceStubSettings.java | 526 ++++ .../showcase/v1beta1/stub/EchoStub.java | 116 + .../v1beta1/stub/EchoStubSettings.java | 713 ++++++ .../stub/GrpcComplianceCallableFactory.java | 115 + .../v1beta1/stub/GrpcComplianceStub.java | 397 ++++ .../v1beta1/stub/GrpcEchoCallableFactory.java | 115 + .../showcase/v1beta1/stub/GrpcEchoStub.java | 413 ++++ .../stub/GrpcIdentityCallableFactory.java | 115 + .../v1beta1/stub/GrpcIdentityStub.java | 272 +++ .../stub/GrpcMessagingCallableFactory.java | 115 + .../v1beta1/stub/GrpcMessagingStub.java | 562 +++++ .../GrpcSequenceServiceCallableFactory.java | 115 + .../v1beta1/stub/GrpcSequenceServiceStub.java | 223 ++ .../stub/GrpcTestingCallableFactory.java | 115 + .../v1beta1/stub/GrpcTestingStub.java | 378 +++ .../HttpJsonComplianceCallableFactory.java | 105 + .../v1beta1/stub/HttpJsonComplianceStub.java | 772 ++++++ .../stub/HttpJsonEchoCallableFactory.java | 105 + .../v1beta1/stub/HttpJsonEchoStub.java | 562 +++++ .../stub/HttpJsonIdentityCallableFactory.java | 105 + .../v1beta1/stub/HttpJsonIdentityStub.java | 406 ++++ .../HttpJsonMessagingCallableFactory.java | 105 + .../v1beta1/stub/HttpJsonMessagingStub.java | 823 +++++++ ...ttpJsonSequenceServiceCallableFactory.java | 105 + .../stub/HttpJsonSequenceServiceStub.java | 302 +++ .../stub/HttpJsonTestingCallableFactory.java | 105 + .../v1beta1/stub/HttpJsonTestingStub.java | 572 +++++ .../showcase/v1beta1/stub/IdentityStub.java | 70 + .../v1beta1/stub/IdentityStubSettings.java | 491 ++++ .../showcase/v1beta1/stub/MessagingStub.java | 144 ++ .../v1beta1/stub/MessagingStubSettings.java | 815 +++++++ .../v1beta1/stub/SequenceServiceStub.java | 54 + .../stub/SequenceServiceStubSettings.java | 387 +++ .../showcase/v1beta1/stub/TestingStub.java | 93 + .../v1beta1/stub/TestingStubSettings.java | 612 +++++ .../v1beta1/ComplianceClientHttpJsonTest.java | 917 +++++++ .../v1beta1/ComplianceClientTest.java | 740 ++++++ .../v1beta1/EchoClientHttpJsonTest.java | 431 ++++ .../showcase/v1beta1/EchoClientTest.java | 562 +++++ .../v1beta1/IdentityClientHttpJsonTest.java | 520 ++++ .../showcase/v1beta1/IdentityClientTest.java | 462 ++++ .../v1beta1/MessagingClientHttpJsonTest.java | 1649 +++++++++++++ .../showcase/v1beta1/MessagingClientTest.java | 1614 +++++++++++++ .../showcase/v1beta1/MockCompliance.java | 59 + .../showcase/v1beta1/MockComplianceImpl.java | 268 +++ .../com/google/showcase/v1beta1/MockEcho.java | 59 + .../google/showcase/v1beta1/MockEchoImpl.java | 277 +++ .../google/showcase/v1beta1/MockIdentity.java | 59 + .../showcase/v1beta1/MockIdentityImpl.java | 162 ++ .../showcase/v1beta1/MockMessaging.java | 59 + .../showcase/v1beta1/MockMessagingImpl.java | 380 +++ .../showcase/v1beta1/MockSequenceService.java | 59 + .../v1beta1/MockSequenceServiceImpl.java | 124 + .../google/showcase/v1beta1/MockTesting.java | 59 + .../showcase/v1beta1/MockTestingImpl.java | 226 ++ .../SequenceServiceClientHttpJsonTest.java | 290 +++ .../v1beta1/SequenceServiceClientTest.java | 264 ++ .../v1beta1/TestingClientHttpJsonTest.java | 472 ++++ .../showcase/v1beta1/TestingClientTest.java | 433 ++++ .../showcase/v1beta1/it/ITFirstHttp.java | 75 + .../showcase/v1beta1/it/ITFirstRpc.java | 75 + .../showcase/v1beta1/it/ITNumericEnums.java | 71 + showcase/google-cloud-jar-parent/pom.xml | 285 +++ showcase/google-cloud-pom-parent/java.header | 15 + .../license-checks.xml | 10 + showcase/google-cloud-pom-parent/pom.xml | 29 + showcase/grpc-gapic-showcase-v1beta1/pom.xml | 72 + .../showcase/v1beta1/ComplianceGrpc.java | 942 ++++++++ .../com/google/showcase/v1beta1/EchoGrpc.java | 829 +++++++ .../google/showcase/v1beta1/IdentityGrpc.java | 572 +++++ .../showcase/v1beta1/MessagingGrpc.java | 1199 ++++++++++ .../showcase/v1beta1/SequenceServiceGrpc.java | 424 ++++ .../google/showcase/v1beta1/TestingGrpc.java | 794 +++++++ showcase/pom.xml | 55 + showcase/proto-gapic-showcase-v1beta1/pom.xml | 64 + showcase/scripts/BUILD.bazel | 3 + showcase/scripts/update.sh | 64 + 95 files changed, 35449 insertions(+) create mode 100644 showcase/BUILD.bazel create mode 100644 showcase/gapic-showcase/pom.xml create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java create mode 100644 showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java create mode 100644 showcase/google-cloud-jar-parent/pom.xml create mode 100644 showcase/google-cloud-pom-parent/java.header create mode 100644 showcase/google-cloud-pom-parent/license-checks.xml create mode 100644 showcase/google-cloud-pom-parent/pom.xml create mode 100644 showcase/grpc-gapic-showcase-v1beta1/pom.xml create mode 100644 showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java create mode 100644 showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java create mode 100644 showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java create mode 100644 showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java create mode 100644 showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java create mode 100644 showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java create mode 100644 showcase/pom.xml create mode 100644 showcase/proto-gapic-showcase-v1beta1/pom.xml create mode 100644 showcase/scripts/BUILD.bazel create mode 100755 showcase/scripts/update.sh diff --git a/.gitignore b/.gitignore index 913a2a8e6e..3211d4544a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ bazel-* .gradle/ target/ +.flattened-pom.xml # IDE .idea diff --git a/showcase/BUILD.bazel b/showcase/BUILD.bazel new file mode 100644 index 0000000000..42c82dec8e --- /dev/null +++ b/showcase/BUILD.bazel @@ -0,0 +1,107 @@ +load( + "//rules_java_gapic:java_gapic.bzl", + "java_gapic_library", + "java_gapic_test", +) +load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") +load("@rules_gapic//:gapic.bzl", "proto_library_with_info") +load("@rules_proto//proto:defs.bzl", "proto_library") +load("//rules_java_gapic:java_gapic_pkg.bzl", "java_gapic_assembly_gradle_pkg") + +package(default_visibility = ["//visibility:public"]) + +proto_library_with_info( + name = "showcase_proto_with_info", + deps = [ + "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto", + "@com_google_googleapis//google/cloud:common_resources_proto", + ], +) + +java_proto_library( + name = "showcase_java_proto", + deps = ["@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto"], +) + +java_grpc_library( + name = "showcase_java_grpc", + srcs = ["@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto"], + deps = [":showcase_java_proto"], +) + +java_gapic_library( + name = "showcase_java_gapic", + srcs = [":showcase_proto_with_info"], + gapic_yaml = None, + grpc_service_config = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_v1beta1.yaml", + test_deps = [ + ":showcase_java_grpc", + ], + transport = "grpc+rest", + deps = [ + ":showcase_java_proto", + "@com_google_googleapis//google/api:api_java_proto", + ], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-showcase-v1beta1-java", + transport = "grpc+rest", + deps = [ + ":showcase_java_gapic", + ":showcase_java_grpc", + ":showcase_java_proto", + "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto", + ], +) + +filegroup( + name = "gapic_showcase_files", + srcs = glob(["gapic-showcase/src/**"]), +) + +filegroup( + name = "grpc_gapic_showcase_files", + srcs = glob(["grpc-gapic-showcase-v1beta1/src/**"]), +) + +filegroup( + name = "proto_gapic_showcase_files", + srcs = glob(["proto-gapic-showcase-v1beta1/src/**"]), +) + +sh_binary( + name = "update_gapic", + srcs = ["//showcase/scripts:update.sh"], + args = ["gapic"], + data = [ + "showcase_java_gapic_srcjar_raw.srcjar", + ":gapic_showcase_files", + "//showcase:showcase_java_gapic", + ], +) + +sh_binary( + name = "update_grpc", + srcs = ["//showcase/scripts:update.sh"], + args = ["grpc"], + data = [ + "libshowcase_java_grpc-src.jar", + ":grpc_gapic_showcase_files", + "//showcase:showcase_java_grpc", + ], +) + +sh_binary( + name = "update_proto", + srcs = ["//showcase/scripts:update.sh"], + args = ["proto"], + data = [ + "proto-google-cloud-showcase-v1beta1-java.tar.gz", + ":proto_gapic_showcase_files", + "//showcase:showcase_java_proto", + ], +) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml new file mode 100644 index 0000000000..94268a2536 --- /dev/null +++ b/showcase/gapic-showcase/pom.xml @@ -0,0 +1,186 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase + 0.0.0-SHAPSHOT + jar + GAPIC Showcase Client + + GAPIC Showcase is an API that demonstrates Generated API Client (GAPIC) features and common API + patterns used by Google. + + + com.google.cloud + gapic-showcase-parent + 0.0.0-SNAPSHOT + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + generate-showcase + + exec + + generate-sources + + bazel + + run + //showcase:update_gapic + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + + prepare-agent-integration + + + + ${project.build.directory}/jacoco-output/jacoco-integration-tests.exec + + failsafe.jacoco.args + + + + report + + report-integration + + + + ${project.build.directory}/jacoco-output/jacoco-integration-tests.exec + + + ${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M7 + + + + integration-test + verify + + + ${failsafe.jacoco.args} + + + + + + + + + + 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-iam-v1 + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + org.threeten + threetenbp + + + + + junit + junit + test + + + com.google.cloud + google-cloud-core + test + + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + \ No newline at end of file diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java new file mode 100644 index 0000000000..266f562e23 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -0,0 +1,946 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.showcase.v1beta1.stub.ComplianceStub; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+ *   RepeatRequest request =
+ *       RepeatRequest.newBuilder()
+ *           .setName("name3373707")
+ *           .setInfo(ComplianceData.newBuilder().build())
+ *           .setServerVerify(true)
+ *           .setIntendedBindingUri("intendedBindingUri780142386")
+ *           .setFInt32(-1143775883)
+ *           .setFInt64(-1143775788)
+ *           .setFDouble(-1239459382)
+ *           .setPInt32(-858673665)
+ *           .setPInt64(-858673570)
+ *           .setPDouble(-991225216)
+ *           .build();
+ *   RepeatResponse response = complianceClient.repeatDataBody(request);
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceClient implements BackgroundResource { + private final ComplianceSettings settings; + private final ComplianceStub stub; + + /** Constructs an instance of ComplianceClient with default settings. */ + public static final ComplianceClient create() throws IOException { + return create(ComplianceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient create(ComplianceSettings settings) throws IOException { + return new ComplianceClient(settings); + } + + /** + * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ComplianceSettings). + */ + public static final ComplianceClient create(ComplianceStub stub) { + return new ComplianceClient(stub); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient(ComplianceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ComplianceClient(ComplianceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ComplianceSettings getSettings() { + return settings; + } + + public ComplianceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataBody(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 RepeatResponse repeatDataBody(RepeatRequest request) { + return repeatDataBodyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataBodyCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataBodyCallable() { + return stub.repeatDataBodyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataBodyInfo(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 RepeatResponse repeatDataBodyInfo(RepeatRequest request) { + return repeatDataBodyInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataBodyInfoCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataBodyInfoCallable() { + return stub.repeatDataBodyInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataQuery(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 RepeatResponse repeatDataQuery(RepeatRequest request) { + return repeatDataQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataQueryCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataQueryCallable() { + return stub.repeatDataQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataSimplePath(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 RepeatResponse repeatDataSimplePath(RepeatRequest request) { + return repeatDataSimplePathCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataSimplePathCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataSimplePathCallable() { + return stub.repeatDataSimplePathCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataPathResource(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 RepeatResponse repeatDataPathResource(RepeatRequest request) { + return repeatDataPathResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataPathResourceCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataPathResourceCallable() { + return stub.repeatDataPathResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataPathTrailingResource(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 RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { + return repeatDataPathTrailingResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + repeatDataPathTrailingResourceCallable() { + return stub.repeatDataPathTrailingResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataBodyPut(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 RepeatResponse repeatDataBodyPut(RepeatRequest request) { + return repeatDataBodyPutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataBodyPutCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataBodyPutCallable() { + return stub.repeatDataBodyPutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataBodyPatch(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 RepeatResponse repeatDataBodyPatch(RepeatRequest request) { + return repeatDataBodyPatchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   RepeatRequest request =
+   *       RepeatRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setIntendedBindingUri("intendedBindingUri780142386")
+   *           .setFInt32(-1143775883)
+   *           .setFInt64(-1143775788)
+   *           .setFDouble(-1239459382)
+   *           .setPInt32(-858673665)
+   *           .setPInt64(-858673570)
+   *           .setPDouble(-991225216)
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataBodyPatchCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataBodyPatchCallable() { + return stub.repeatDataBodyPatchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
+   *   EnumResponse response = complianceClient.getEnum(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 EnumResponse getEnum(EnumRequest request) { + return getEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
+   *   ApiFuture future = complianceClient.getEnumCallable().futureCall(request);
+   *   // Do something.
+   *   EnumResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEnumCallable() { + return stub.getEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   EnumResponse request =
+   *       EnumResponse.newBuilder()
+   *           .setRequest(EnumRequest.newBuilder().build())
+   *           .setContinent(Continent.forNumber(0))
+   *           .build();
+   *   EnumResponse response = complianceClient.verifyEnum(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 EnumResponse verifyEnum(EnumResponse request) { + return verifyEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   EnumResponse request =
+   *       EnumResponse.newBuilder()
+   *           .setRequest(EnumRequest.newBuilder().build())
+   *           .setContinent(Continent.forNumber(0))
+   *           .build();
+   *   ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request);
+   *   // Do something.
+   *   EnumResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable verifyEnumCallable() { + return stub.verifyEnumCallable(); + } + + @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); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java new file mode 100644 index 0000000000..8b562e3999 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -0,0 +1,297 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +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 ComplianceClient}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 repeatDataBody to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder();
+ * complianceSettingsBuilder
+ *     .repeatDataBodySettings()
+ *     .setRetrySettings(
+ *         complianceSettingsBuilder
+ *             .repeatDataBodySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyInfoSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataQuerySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataSimplePathSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathTrailingResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPutSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPatchSettings(); + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).getEnumSettings(); + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); + } + + public static final ComplianceSettings create(ComplianceStubSettings stub) throws IOException { + return new ComplianceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ComplianceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ComplianceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ComplianceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ComplianceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ComplianceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ComplianceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ComplianceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ComplianceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ComplianceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ComplianceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ComplianceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ComplianceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ComplianceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(ComplianceStubSettings.newHttpJsonBuilder()); + } + + public ComplianceStubSettings.Builder getStubSettingsBuilder() { + return ((ComplianceStubSettings.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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return getStubSettingsBuilder().repeatDataBodySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return getStubSettingsBuilder().repeatDataBodyInfoSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return getStubSettingsBuilder().repeatDataQuerySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return getStubSettingsBuilder().repeatDataSimplePathSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return getStubSettingsBuilder().repeatDataPathResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return getStubSettingsBuilder().repeatDataPathTrailingResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return getStubSettingsBuilder().repeatDataBodyPutSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return getStubSettingsBuilder().repeatDataBodyPatchSettings(); + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getStubSettingsBuilder().getEnumSettings(); + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return getStubSettingsBuilder().verifyEnumSettings(); + } + + @Override + public ComplianceSettings build() throws IOException { + return new ComplianceSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java new file mode 100644 index 0000000000..43d886930d --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -0,0 +1,999 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ *   EchoRequest request =
+ *       EchoRequest.newBuilder()
+ *           .setSeverity(Severity.forNumber(0))
+ *           .setHeader("header-1221270899")
+ *           .setOtherHeader("otherHeader-2026585667")
+ *           .build();
+ *   EchoResponse response = echoClient.echo(request);
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoClient implements BackgroundResource { + private final EchoSettings settings; + private final EchoStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of EchoClient with default settings. */ + public static final EchoClient create() throws IOException { + return create(EchoSettings.newBuilder().build()); + } + + /** + * Constructs an instance of EchoClient, 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 EchoClient create(EchoSettings settings) throws IOException { + return new EchoClient(settings); + } + + /** + * Constructs an instance of EchoClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(EchoSettings). + */ + public static final EchoClient create(EchoStub stub) { + return new EchoClient(stub); + } + + /** + * Constructs an instance of EchoClient, 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 EchoClient(EchoSettings settings) throws IOException { + this.settings = settings; + this.stub = ((EchoStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected EchoClient(EchoStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final EchoSettings getSettings() { + return settings; + } + + public EchoStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method simply echoes the request. This method showcases unary RPCs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   EchoRequest request =
+   *       EchoRequest.newBuilder()
+   *           .setSeverity(Severity.forNumber(0))
+   *           .setHeader("header-1221270899")
+   *           .setOtherHeader("otherHeader-2026585667")
+   *           .build();
+   *   EchoResponse response = echoClient.echo(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 EchoResponse echo(EchoRequest request) { + return echoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method simply echoes the request. This method showcases unary RPCs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   EchoRequest request =
+   *       EchoRequest.newBuilder()
+   *           .setSeverity(Severity.forNumber(0))
+   *           .setHeader("header-1221270899")
+   *           .setOtherHeader("otherHeader-2026585667")
+   *           .build();
+   *   ApiFuture future = echoClient.echoCallable().futureCall(request);
+   *   // Do something.
+   *   EchoResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable echoCallable() { + return stub.echoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method splits the given content into words and will pass each word back through the + * stream. This method showcases server-side streaming RPCs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   ExpandRequest request =
+   *       ExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setError(Status.newBuilder().build())
+   *           .build();
+   *   ServerStream stream = echoClient.expandCallable().call(request);
+   *   for (EchoResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable expandCallable() { + return stub.expandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will collect the words given to it. When the stream is closed by the client, this + * method will return the a concatenation of the strings passed to it. This method showcases + * client-side streaming RPCs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   ApiStreamObserver responseObserver =
+   *       new ApiStreamObserver() {
+   *         {@literal @}Override
+   *         public void onNext(EchoResponse response) {
+   *           // Do something when a response is received.
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onError(Throwable t) {
+   *           // Add error-handling
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onCompleted() {
+   *           // Do something when complete.
+   *         }
+   *       };
+   *   ApiStreamObserver requestObserver =
+   *       echoClient.collect().clientStreamingCall(responseObserver);
+   *   EchoRequest request =
+   *       EchoRequest.newBuilder()
+   *           .setSeverity(Severity.forNumber(0))
+   *           .setHeader("header-1221270899")
+   *           .setOtherHeader("otherHeader-2026585667")
+   *           .build();
+   *   requestObserver.onNext(request);
+   * }
+   * }
+ */ + public final ClientStreamingCallable collectCallable() { + return stub.collectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method, upon receiving a request on the stream, will pass the same content back on the + * stream. This method showcases bidirectional streaming RPCs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   BidiStream bidiStream = echoClient.chatCallable().call();
+   *   EchoRequest request =
+   *       EchoRequest.newBuilder()
+   *           .setSeverity(Severity.forNumber(0))
+   *           .setHeader("header-1221270899")
+   *           .setOtherHeader("otherHeader-2026585667")
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (EchoResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable chatCallable() { + return stub.chatCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandRequest request =
+   *       PagedExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (EchoResponse element : echoClient.pagedExpand(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 PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) { + return pagedExpandPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandRequest request =
+   *       PagedExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (EchoResponse element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + pagedExpandPagedCallable() { + return stub.pagedExpandPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandRequest request =
+   *       PagedExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
+   *     for (EchoResponse element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable pagedExpandCallable() { + return stub.pagedExpandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandLegacyRequest request =
+   *       PagedExpandLegacyRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { + return pagedExpandLegacyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandLegacyRequest request =
+   *       PagedExpandLegacyRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
+   *   // Do something.
+   *   PagedExpandResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + pagedExpandLegacyCallable() { + return stub.pagedExpandLegacyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandRequest request =
+   *       PagedExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Map.Entry element :
+   *       echoClient.pagedExpandLegacyMapped(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 PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped( + PagedExpandRequest request) { + return pagedExpandLegacyMappedPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandRequest request =
+   *       PagedExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture> future =
+   *       echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Map.Entry element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return stub.pagedExpandLegacyMappedPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   PagedExpandRequest request =
+   *       PagedExpandRequest.newBuilder()
+   *           .setContent("content951530617")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     PagedExpandLegacyMappedResponse response =
+   *         echoClient.pagedExpandLegacyMappedCallable().call(request);
+   *     for (Map.Entry element : response.getAlphabetizedList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + pagedExpandLegacyMappedCallable() { + return stub.pagedExpandLegacyMappedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   WaitRequest request = WaitRequest.newBuilder().build();
+   *   WaitResponse response = echoClient.waitAsync(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 waitAsync(WaitRequest request) { + return waitOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   WaitRequest request = WaitRequest.newBuilder().build();
+   *   OperationFuture future =
+   *       echoClient.waitOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WaitResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable waitOperationCallable() { + return stub.waitOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   WaitRequest request = WaitRequest.newBuilder().build();
+   *   ApiFuture future = echoClient.waitCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable waitCallable() { + return stub.waitCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   BlockRequest request =
+   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
+   *   BlockResponse response = echoClient.block(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 BlockResponse block(BlockRequest request) { + return blockCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EchoClient echoClient = EchoClient.create()) {
+   *   BlockRequest request =
+   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
+   *   ApiFuture future = echoClient.blockCallable().futureCall(request);
+   *   // Do something.
+   *   BlockResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable blockCallable() { + return stub.blockCallable(); + } + + @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 PagedExpandPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new PagedExpandPagedResponse(input), MoreExecutors.directExecutor()); + } + + private PagedExpandPagedResponse(PagedExpandPage page) { + super(page, PagedExpandFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandPage + extends AbstractPage { + + private PagedExpandPage( + PageContext context, + PagedExpandResponse response) { + super(context, response); + } + + private static PagedExpandPage createEmptyPage() { + return new PagedExpandPage(null, null); + } + + @Override + protected PagedExpandPage createPage( + PageContext context, + PagedExpandResponse response) { + return new PagedExpandPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandFixedSizeCollection createEmptyCollection() { + return new PagedExpandFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandFixedSizeCollection(pages, collectionSize); + } + } + + public static class PagedExpandLegacyMappedPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandLegacyMappedPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new PagedExpandLegacyMappedPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private PagedExpandLegacyMappedPagedResponse(PagedExpandLegacyMappedPage page) { + super(page, PagedExpandLegacyMappedFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandLegacyMappedPage + extends AbstractPage< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage> { + + private PagedExpandLegacyMappedPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + super(context, response); + } + + private static PagedExpandLegacyMappedPage createEmptyPage() { + return new PagedExpandLegacyMappedPage(null, null); + } + + @Override + protected PagedExpandLegacyMappedPage createPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + return new PagedExpandLegacyMappedPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandLegacyMappedFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + private PagedExpandLegacyMappedFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection() { + return new PagedExpandLegacyMappedFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandLegacyMappedFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java new file mode 100644 index 0000000000..b8c1785ef0 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -0,0 +1,315 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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 EchoClient}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 echo to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
+ * echoSettingsBuilder
+ *     .echoSettings()
+ *     .setRetrySettings(
+ *         echoSettingsBuilder
+ *             .echoSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * EchoSettings echoSettings = echoSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return ((EchoStubSettings) getStubSettings()).echoSettings(); + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return ((EchoStubSettings) getStubSettings()).expandSettings(); + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return ((EchoStubSettings) getStubSettings()).collectSettings(); + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return ((EchoStubSettings) getStubSettings()).chatSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacyMappedSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return ((EchoStubSettings) getStubSettings()).waitSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return ((EchoStubSettings) getStubSettings()).waitOperationSettings(); + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return ((EchoStubSettings) getStubSettings()).blockSettings(); + } + + public static final EchoSettings create(EchoStubSettings stub) throws IOException { + return new EchoSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EchoStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EchoStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EchoStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EchoStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EchoStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return EchoStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EchoStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected EchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EchoSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(EchoStubSettings.newBuilder(clientContext)); + } + + protected Builder(EchoSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(EchoStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(EchoStubSettings.newHttpJsonBuilder()); + } + + public EchoStubSettings.Builder getStubSettingsBuilder() { + return ((EchoStubSettings.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return getStubSettingsBuilder().echoSettings(); + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return getStubSettingsBuilder().expandSettings(); + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return getStubSettingsBuilder().collectSettings(); + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return getStubSettingsBuilder().chatSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return getStubSettingsBuilder().pagedExpandSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return getStubSettingsBuilder().pagedExpandLegacySettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return getStubSettingsBuilder().pagedExpandLegacyMappedSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return getStubSettingsBuilder().waitSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return getStubSettingsBuilder().waitOperationSettings(); + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return getStubSettingsBuilder().blockSettings(); + } + + @Override + public EchoSettings build() throws IOException { + return new EchoSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java new file mode 100644 index 0000000000..b50159d6fc --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java @@ -0,0 +1,774 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStub; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple identity service. + * + *

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

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

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentityClient implements BackgroundResource { + private final IdentitySettings settings; + private final IdentityStub stub; + + /** Constructs an instance of IdentityClient with default settings. */ + public static final IdentityClient create() throws IOException { + return create(IdentitySettings.newBuilder().build()); + } + + /** + * Constructs an instance of IdentityClient, 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 IdentityClient create(IdentitySettings settings) throws IOException { + return new IdentityClient(settings); + } + + /** + * Constructs an instance of IdentityClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(IdentitySettings). + */ + public static final IdentityClient create(IdentityStub stub) { + return new IdentityClient(stub); + } + + /** + * Constructs an instance of IdentityClient, 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 IdentityClient(IdentitySettings settings) throws IOException { + this.settings = settings; + this.stub = ((IdentityStubSettings) settings.getStubSettings()).createStub(); + } + + protected IdentityClient(IdentityStub stub) { + this.settings = null; + this.stub = stub; + } + + public final IdentitySettings getSettings() { + return settings; + } + + public IdentityStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   String displayName = "displayName1714148973";
+   *   String email = "email96619420";
+   *   User response = identityClient.createUser(displayName, email);
+   * }
+   * }
+ * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(String displayName, String email) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser(User.newBuilder().setDisplayName(displayName).setEmail(email).build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   String displayName = "displayName1714148973";
+   *   String email = "email96619420";
+   *   int age = 96511;
+   *   String nickname = "nickname70690926";
+   *   boolean enableNotifications = true;
+   *   double heightFeet = -1032737338;
+   *   User response =
+   *       identityClient.createUser(
+   *           displayName, email, age, nickname, enableNotifications, heightFeet);
+   * }
+   * }
+ * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @param age The age of the user in years. + * @param nickname The nickname of the user. + *

(-- aip.dev/not-precedent: An empty string is a valid nickname. Ordinarily, + * proto3_optional should not be used on a `string` field. --) + * @param enableNotifications Enables the receiving of notifications. The default is true if + * unset. + *

(-- aip.dev/not-precedent: The default for the feature is true. Ordinarily, the default + * for a `bool` field should be false. --) + * @param heightFeet The height of the user in feet. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser( + String displayName, + String email, + int age, + String nickname, + boolean enableNotifications, + double heightFeet) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setDisplayName(displayName) + .setEmail(email) + .setAge(age) + .setNickname(nickname) + .setEnableNotifications(enableNotifications) + .setHeightFeet(heightFeet) + .build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   CreateUserRequest request =
+   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
+   *   User response = identityClient.createUser(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 User createUser(CreateUserRequest request) { + return createUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   UserName name = UserName.of("[USER]");
+   *   User response = identityClient.getUser(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   String name = UserName.of("[USER]").toString();
+   *   User response = identityClient.getUser(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   GetUserRequest request =
+   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
+   *   User response = identityClient.getUser(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 User getUser(GetUserRequest request) { + return getUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   GetUserRequest request =
+   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
+   *   ApiFuture future = identityClient.getUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUser(User.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   User response = identityClient.updateUser(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 User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUser(User.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = identityClient.updateUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   UserName name = UserName.of("[USER]");
+   *   identityClient.deleteUser(name);
+   * }
+   * }
+ * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   String name = UserName.of("[USER]").toString();
+   *   identityClient.deleteUser(name);
+   * }
+   * }
+ * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   DeleteUserRequest request =
+   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
+   *   identityClient.deleteUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   DeleteUserRequest request =
+   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
+   *   ApiFuture future = identityClient.deleteUserCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (User element : identityClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) { + return listUsersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (User element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (IdentityClient identityClient = IdentityClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListUsersResponse response = identityClient.listUsersCallable().call(request);
+   *     for (User element : response.getUsersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); + } + + @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 ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java new file mode 100644 index 0000000000..f4db5be8a8 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -0,0 +1,251 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +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 IdentityClient}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createUser to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder();
+ * identitySettingsBuilder
+ *     .createUserSettings()
+ *     .setRetrySettings(
+ *         identitySettingsBuilder
+ *             .createUserSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * IdentitySettings identitySettings = identitySettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentitySettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((IdentityStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((IdentityStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((IdentityStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((IdentityStubSettings) getStubSettings()).deleteUserSettings(); + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((IdentityStubSettings) getStubSettings()).listUsersSettings(); + } + + public static final IdentitySettings create(IdentityStubSettings stub) throws IOException { + return new IdentitySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return IdentityStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return IdentityStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return IdentityStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return IdentityStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return IdentityStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return IdentityStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return IdentityStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected IdentitySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for IdentitySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(IdentityStubSettings.newBuilder(clientContext)); + } + + protected Builder(IdentitySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(IdentityStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(IdentityStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(IdentityStubSettings.newHttpJsonBuilder()); + } + + public IdentityStubSettings.Builder getStubSettingsBuilder() { + return ((IdentityStubSettings.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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + @Override + public IdentitySettings build() throws IOException { + return new IdentitySettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java new file mode 100644 index 0000000000..e19a62a25b --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -0,0 +1,2117 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStub; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

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

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

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingClient implements BackgroundResource { + private final MessagingSettings settings; + private final MessagingStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of MessagingClient with default settings. */ + public static final MessagingClient create() throws IOException { + return create(MessagingSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MessagingClient, 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 MessagingClient create(MessagingSettings settings) throws IOException { + return new MessagingClient(settings); + } + + /** + * Constructs an instance of MessagingClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(MessagingSettings). + */ + public static final MessagingClient create(MessagingStub stub) { + return new MessagingClient(stub); + } + + /** + * Constructs an instance of MessagingClient, 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 MessagingClient(MessagingSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MessagingStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected MessagingClient(MessagingStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final MessagingSettings getSettings() { + return settings; + } + + public MessagingStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String displayName = "displayName1714148973";
+   *   String description = "description-1724546052";
+   *   Room response = messagingClient.createRoom(displayName, description);
+   * }
+   * }
+ * + * @param displayName The human readable name of the chat room. + * @param description The description of the chat room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room createRoom(String displayName, String description) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder().setDisplayName(displayName).setDescription(description).build()) + .build(); + return createRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   CreateRoomRequest request =
+   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
+   *   Room response = messagingClient.createRoom(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 Room createRoom(CreateRoomRequest request) { + return createRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   CreateRoomRequest request =
+   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
+   *   ApiFuture future = messagingClient.createRoomCallable().futureCall(request);
+   *   // Do something.
+   *   Room response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createRoomCallable() { + return stub.createRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName name = RoomName.of("[ROOM]");
+   *   Room response = messagingClient.getRoom(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(RoomName name) { + GetRoomRequest request = + GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String name = RoomName.of("[ROOM]").toString();
+   *   Room response = messagingClient.getRoom(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(String name) { + GetRoomRequest request = GetRoomRequest.newBuilder().setName(name).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   GetRoomRequest request =
+   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
+   *   Room response = messagingClient.getRoom(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 Room getRoom(GetRoomRequest request) { + return getRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   GetRoomRequest request =
+   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
+   *   ApiFuture future = messagingClient.getRoomCallable().futureCall(request);
+   *   // Do something.
+   *   Room response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getRoomCallable() { + return stub.getRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   UpdateRoomRequest request =
+   *       UpdateRoomRequest.newBuilder()
+   *           .setRoom(Room.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Room response = messagingClient.updateRoom(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 Room updateRoom(UpdateRoomRequest request) { + return updateRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   UpdateRoomRequest request =
+   *       UpdateRoomRequest.newBuilder()
+   *           .setRoom(Room.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = messagingClient.updateRoomCallable().futureCall(request);
+   *   // Do something.
+   *   Room response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateRoomCallable() { + return stub.updateRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName name = RoomName.of("[ROOM]");
+   *   messagingClient.deleteRoom(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(RoomName name) { + DeleteRoomRequest request = + DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String name = RoomName.of("[ROOM]").toString();
+   *   messagingClient.deleteRoom(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(String name) { + DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   DeleteRoomRequest request =
+   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
+   *   messagingClient.deleteRoom(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(DeleteRoomRequest request) { + deleteRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   DeleteRoomRequest request =
+   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
+   *   ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteRoomCallable() { + return stub.deleteRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ListRoomsRequest request =
+   *       ListRoomsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Room element : messagingClient.listRooms(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 ListRoomsPagedResponse listRooms(ListRoomsRequest request) { + return listRoomsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ListRoomsRequest request =
+   *       ListRoomsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Room element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listRoomsPagedCallable() { + return stub.listRoomsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ListRoomsRequest request =
+   *       ListRoomsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
+   *     for (Room element : response.getRoomsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listRoomsCallable() { + return stub.listRoomsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ProfileName parent = ProfileName.of("[USER]");
+   *   UserName user = UserName.of("[USER]");
+   *   ByteString image = ByteString.EMPTY;
+   *   Blurb response = messagingClient.createBlurb(parent, user, image);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ProfileName parent = ProfileName.of("[USER]");
+   *   UserName user = UserName.of("[USER]");
+   *   String text = "text3556653";
+   *   Blurb response = messagingClient.createBlurb(parent, user, text);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ProfileName parent = ProfileName.of("[USER]");
+   *   String user = UserName.of("[USER]").toString();
+   *   ByteString image = ByteString.EMPTY;
+   *   Blurb response = messagingClient.createBlurb(parent, user, image);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ProfileName parent = ProfileName.of("[USER]");
+   *   String user = UserName.of("[USER]").toString();
+   *   String text = "text3556653";
+   *   Blurb response = messagingClient.createBlurb(parent, user, text);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName parent = RoomName.of("[ROOM]");
+   *   UserName user = UserName.of("[USER]");
+   *   ByteString image = ByteString.EMPTY;
+   *   Blurb response = messagingClient.createBlurb(parent, user, image);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName parent = RoomName.of("[ROOM]");
+   *   UserName user = UserName.of("[USER]");
+   *   String text = "text3556653";
+   *   Blurb response = messagingClient.createBlurb(parent, user, text);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName parent = RoomName.of("[ROOM]");
+   *   String user = UserName.of("[USER]").toString();
+   *   ByteString image = ByteString.EMPTY;
+   *   Blurb response = messagingClient.createBlurb(parent, user, image);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName parent = RoomName.of("[ROOM]");
+   *   String user = UserName.of("[USER]").toString();
+   *   String text = "text3556653";
+   *   Blurb response = messagingClient.createBlurb(parent, user, text);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String parent = ProfileName.of("[USER]").toString();
+   *   UserName user = UserName.of("[USER]");
+   *   ByteString image = ByteString.EMPTY;
+   *   Blurb response = messagingClient.createBlurb(parent, user, image);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String parent = ProfileName.of("[USER]").toString();
+   *   UserName user = UserName.of("[USER]");
+   *   String text = "text3556653";
+   *   Blurb response = messagingClient.createBlurb(parent, user, text);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String parent = ProfileName.of("[USER]").toString();
+   *   String user = UserName.of("[USER]").toString();
+   *   ByteString image = ByteString.EMPTY;
+   *   Blurb response = messagingClient.createBlurb(parent, user, image);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String parent = ProfileName.of("[USER]").toString();
+   *   String user = UserName.of("[USER]").toString();
+   *   String text = "text3556653";
+   *   Blurb response = messagingClient.createBlurb(parent, user, text);
+   * }
+   * }
+ * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   CreateBlurbRequest request =
+   *       CreateBlurbRequest.newBuilder()
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setBlurb(Blurb.newBuilder().build())
+   *           .build();
+   *   Blurb response = messagingClient.createBlurb(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 Blurb createBlurb(CreateBlurbRequest request) { + return createBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   CreateBlurbRequest request =
+   *       CreateBlurbRequest.newBuilder()
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setBlurb(Blurb.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = messagingClient.createBlurbCallable().futureCall(request);
+   *   // Do something.
+   *   Blurb response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBlurbCallable() { + return stub.createBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
+   *   Blurb response = messagingClient.getBlurb(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(BlurbName name) { + GetBlurbRequest request = + GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String name =
+   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
+   *   Blurb response = messagingClient.getBlurb(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(String name) { + GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   GetBlurbRequest request =
+   *       GetBlurbRequest.newBuilder()
+   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .build();
+   *   Blurb response = messagingClient.getBlurb(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 Blurb getBlurb(GetBlurbRequest request) { + return getBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   GetBlurbRequest request =
+   *       GetBlurbRequest.newBuilder()
+   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .build();
+   *   ApiFuture future = messagingClient.getBlurbCallable().futureCall(request);
+   *   // Do something.
+   *   Blurb response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBlurbCallable() { + return stub.getBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   UpdateBlurbRequest request =
+   *       UpdateBlurbRequest.newBuilder()
+   *           .setBlurb(Blurb.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Blurb response = messagingClient.updateBlurb(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 Blurb updateBlurb(UpdateBlurbRequest request) { + return updateBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
+   *   messagingClient.deleteBlurb(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(BlurbName name) { + DeleteBlurbRequest request = + DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String name =
+   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
+   *   messagingClient.deleteBlurb(name);
+   * }
+   * }
+ * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(String name) { + DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   DeleteBlurbRequest request =
+   *       DeleteBlurbRequest.newBuilder()
+   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .build();
+   *   messagingClient.deleteBlurb(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(DeleteBlurbRequest request) { + deleteBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   DeleteBlurbRequest request =
+   *       DeleteBlurbRequest.newBuilder()
+   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .build();
+   *   ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBlurbCallable() { + return stub.deleteBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ProfileName parent = ProfileName.of("[USER]");
+   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent The resource name of the requested room or profile whos blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName parent = RoomName.of("[ROOM]");
+   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent The resource name of the requested room or profile whos blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String parent = ProfileName.of("[USER]").toString();
+   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent The resource name of the requested room or profile whos blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(String parent) { + ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ListBlurbsRequest request =
+   *       ListBlurbsRequest.newBuilder()
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Blurb element : messagingClient.listBlurbs(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 ListBlurbsPagedResponse listBlurbs(ListBlurbsRequest request) { + return listBlurbsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ListBlurbsRequest request =
+   *       ListBlurbsRequest.newBuilder()
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Blurb element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBlurbsPagedCallable() { + return stub.listBlurbsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ListBlurbsRequest request =
+   *       ListBlurbsRequest.newBuilder()
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
+   *     for (Blurb element : response.getBlurbsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBlurbsCallable() { + return stub.listBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ProfileName parent = ProfileName.of("[USER]");
+   *   String query = "query107944136";
+   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
+   * }
+   * }
+ * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + ProfileName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   RoomName parent = RoomName.of("[ROOM]");
+   *   String query = "query107944136";
+   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
+   * }
+   * }
+ * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + RoomName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   String parent = ProfileName.of("[USER]").toString();
+   *   String query = "query107944136";
+   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
+   * }
+   * }
+ * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + String parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   SearchBlurbsRequest request =
+   *       SearchBlurbsRequest.newBuilder()
+   *           .setQuery("query107944136")
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(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 searchBlurbsAsync( + SearchBlurbsRequest request) { + return searchBlurbsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   SearchBlurbsRequest request =
+   *       SearchBlurbsRequest.newBuilder()
+   *           .setQuery("query107944136")
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   OperationFuture future =
+   *       messagingClient.searchBlurbsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   SearchBlurbsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + searchBlurbsOperationCallable() { + return stub.searchBlurbsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   SearchBlurbsRequest request =
+   *       SearchBlurbsRequest.newBuilder()
+   *           .setQuery("query107944136")
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable searchBlurbsCallable() { + return stub.searchBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This returns a stream that emits the blurbs that are created for a particular chat room or user + * profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   StreamBlurbsRequest request =
+   *       StreamBlurbsRequest.newBuilder()
+   *           .setName(ProfileName.of("[USER]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ServerStream stream =
+   *       messagingClient.streamBlurbsCallable().call(request);
+   *   for (StreamBlurbsResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable + streamBlurbsCallable() { + return stub.streamBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the + * stream will close with an error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   ApiStreamObserver responseObserver =
+   *       new ApiStreamObserver() {
+   *         {@literal @}Override
+   *         public void onNext(SendBlurbsResponse response) {
+   *           // Do something when a response is received.
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onError(Throwable t) {
+   *           // Add error-handling
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onCompleted() {
+   *           // Do something when complete.
+   *         }
+   *       };
+   *   ApiStreamObserver requestObserver =
+   *       messagingClient.sendBlurbs().clientStreamingCall(responseObserver);
+   *   CreateBlurbRequest request =
+   *       CreateBlurbRequest.newBuilder()
+   *           .setParent(ProfileName.of("[USER]").toString())
+   *           .setBlurb(Blurb.newBuilder().build())
+   *           .build();
+   *   requestObserver.onNext(request);
+   * }
+   * }
+ */ + public final ClientStreamingCallable + sendBlurbsCallable() { + return stub.sendBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method starts a bidirectional stream that receives all blurbs that are being created after + * the stream has started and sends requests to create blurbs. If an invalid blurb is requested to + * be created, the stream will close with an error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MessagingClient messagingClient = MessagingClient.create()) {
+   *   BidiStream bidiStream =
+   *       messagingClient.connectCallable().call();
+   *   ConnectRequest request = ConnectRequest.newBuilder().build();
+   *   bidiStream.send(request);
+   *   for (StreamBlurbsResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable connectCallable() { + return stub.connectCallable(); + } + + @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 ListRoomsPagedResponse + extends AbstractPagedListResponse< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRoomsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListRoomsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListRoomsPagedResponse(ListRoomsPage page) { + super(page, ListRoomsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRoomsPage + extends AbstractPage { + + private ListRoomsPage( + PageContext context, + ListRoomsResponse response) { + super(context, response); + } + + private static ListRoomsPage createEmptyPage() { + return new ListRoomsPage(null, null); + } + + @Override + protected ListRoomsPage createPage( + PageContext context, + ListRoomsResponse response) { + return new ListRoomsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRoomsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + private ListRoomsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRoomsFixedSizeCollection createEmptyCollection() { + return new ListRoomsFixedSizeCollection(null, 0); + } + + @Override + protected ListRoomsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRoomsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBlurbsPagedResponse + extends AbstractPagedListResponse< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBlurbsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBlurbsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBlurbsPagedResponse(ListBlurbsPage page) { + super(page, ListBlurbsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBlurbsPage + extends AbstractPage { + + private ListBlurbsPage( + PageContext context, + ListBlurbsResponse response) { + super(context, response); + } + + private static ListBlurbsPage createEmptyPage() { + return new ListBlurbsPage(null, null); + } + + @Override + protected ListBlurbsPage createPage( + PageContext context, + ListBlurbsResponse response) { + return new ListBlurbsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBlurbsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBlurbsFixedSizeCollection createEmptyCollection() { + return new ListBlurbsFixedSizeCollection(null, 0); + } + + @Override + protected ListBlurbsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBlurbsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java new file mode 100644 index 0000000000..2196181ea3 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -0,0 +1,364 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +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 MessagingClient}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createRoom to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
+ * messagingSettingsBuilder
+ *     .createRoomSettings()
+ *     .setRetrySettings(
+ *         messagingSettingsBuilder
+ *             .createRoomSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MessagingSettings messagingSettings = messagingSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).createRoomSettings(); + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).getRoomSettings(); + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).updateRoomSettings(); + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteRoomSettings(); + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return ((MessagingStubSettings) getStubSettings()).listRoomsSettings(); + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).createBlurbSettings(); + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).getBlurbSettings(); + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).updateBlurbSettings(); + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteBlurbSettings(); + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).listBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsOperationSettings(); + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).streamBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).sendBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return ((MessagingStubSettings) getStubSettings()).connectSettings(); + } + + public static final MessagingSettings create(MessagingStubSettings stub) throws IOException { + return new MessagingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MessagingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MessagingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MessagingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MessagingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MessagingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MessagingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MessagingStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MessagingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MessagingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MessagingStubSettings.newBuilder(clientContext)); + } + + protected Builder(MessagingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MessagingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MessagingStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(MessagingStubSettings.newHttpJsonBuilder()); + } + + public MessagingStubSettings.Builder getStubSettingsBuilder() { + return ((MessagingStubSettings.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return getStubSettingsBuilder().createRoomSettings(); + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getStubSettingsBuilder().getRoomSettings(); + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return getStubSettingsBuilder().updateRoomSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return getStubSettingsBuilder().deleteRoomSettings(); + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return getStubSettingsBuilder().listRoomsSettings(); + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return getStubSettingsBuilder().createBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getStubSettingsBuilder().getBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return getStubSettingsBuilder().updateBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return getStubSettingsBuilder().deleteBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return getStubSettingsBuilder().listBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return getStubSettingsBuilder().searchBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return getStubSettingsBuilder().searchBlurbsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return getStubSettingsBuilder().streamBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return getStubSettingsBuilder().sendBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return getStubSettingsBuilder().connectSettings(); + } + + @Override + public MessagingSettings build() throws IOException { + return new MessagingSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java new file mode 100644 index 0000000000..3a5221b5ef --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -0,0 +1,498 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStub; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * This class provides the ability to make remote calls to the backing service through method calls + * that map to API methods. Sample code to get started: + * + *

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

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceClient implements BackgroundResource { + private final SequenceServiceSettings settings; + private final SequenceServiceStub stub; + + /** Constructs an instance of SequenceServiceClient with default settings. */ + public static final SequenceServiceClient create() throws IOException { + return create(SequenceServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SequenceServiceClient, 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 SequenceServiceClient create(SequenceServiceSettings settings) + throws IOException { + return new SequenceServiceClient(settings); + } + + /** + * Constructs an instance of SequenceServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SequenceServiceSettings). + */ + public static final SequenceServiceClient create(SequenceServiceStub stub) { + return new SequenceServiceClient(stub); + } + + /** + * Constructs an instance of SequenceServiceClient, 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 SequenceServiceClient(SequenceServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SequenceServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SequenceServiceClient(SequenceServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SequenceServiceSettings getSettings() { + return settings; + } + + public SequenceServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   Sequence sequence = Sequence.newBuilder().build();
+   *   Sequence response = sequenceServiceClient.createSequence(sequence);
+   * }
+   * }
+ * + * @param sequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Sequence createSequence(Sequence sequence) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(sequence).build(); + return createSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   CreateSequenceRequest request =
+   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
+   *   Sequence response = sequenceServiceClient.createSequence(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 Sequence createSequence(CreateSequenceRequest request) { + return createSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   SequenceReportName name = SequenceReportName.of("[SEQUENCE]");
+   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
+   * }
+   * }
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(SequenceReportName name) { + GetSequenceReportRequest request = + GetSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   String name = SequenceReportName.of("[SEQUENCE]").toString();
+   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
+   * }
+   * }
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(String name) { + GetSequenceReportRequest request = GetSequenceReportRequest.newBuilder().setName(name).build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   GetSequenceReportRequest request =
+   *       GetSequenceReportRequest.newBuilder()
+   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
+   *           .build();
+   *   SequenceReport response = sequenceServiceClient.getSequenceReport(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 SequenceReport getSequenceReport(GetSequenceReportRequest request) { + return getSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   GetSequenceReportRequest request =
+   *       GetSequenceReportRequest.newBuilder()
+   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       sequenceServiceClient.getSequenceReportCallable().futureCall(request);
+   *   // Do something.
+   *   SequenceReport response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSequenceReportCallable() { + return stub.getSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   SequenceName name = SequenceName.of("[SEQUENCE]");
+   *   sequenceServiceClient.attemptSequence(name);
+   * }
+   * }
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(SequenceName name) { + AttemptSequenceRequest request = + AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   String name = SequenceName.of("[SEQUENCE]").toString();
+   *   sequenceServiceClient.attemptSequence(name);
+   * }
+   * }
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(String name) { + AttemptSequenceRequest request = AttemptSequenceRequest.newBuilder().setName(name).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   AttemptSequenceRequest request =
+   *       AttemptSequenceRequest.newBuilder()
+   *           .setName(SequenceName.of("[SEQUENCE]").toString())
+   *           .build();
+   *   sequenceServiceClient.attemptSequence(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(AttemptSequenceRequest request) { + attemptSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
+   *   AttemptSequenceRequest request =
+   *       AttemptSequenceRequest.newBuilder()
+   *           .setName(SequenceName.of("[SEQUENCE]").toString())
+   *           .build();
+   *   ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable attemptSequenceCallable() { + return stub.attemptSequenceCallable(); + } + + @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); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java new file mode 100644 index 0000000000..7b6225a1ee --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -0,0 +1,229 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +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 SequenceServiceClient}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createSequence to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SequenceServiceSettings.Builder sequenceServiceSettingsBuilder =
+ *     SequenceServiceSettings.newBuilder();
+ * sequenceServiceSettingsBuilder
+ *     .createSequenceSettings()
+ *     .setRetrySettings(
+ *         sequenceServiceSettingsBuilder
+ *             .createSequenceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createSequenceSettings(); + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); + } + + public static final SequenceServiceSettings create(SequenceServiceStubSettings stub) + throws IOException { + return new SequenceServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SequenceServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SequenceServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SequenceServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SequenceServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SequenceServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SequenceServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SequenceServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SequenceServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SequenceServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SequenceServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SequenceServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SequenceServiceStubSettings.newHttpJsonBuilder()); + } + + public SequenceServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SequenceServiceStubSettings.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 createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return getStubSettingsBuilder().createSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getStubSettingsBuilder().getSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return getStubSettingsBuilder().attemptSequenceSettings(); + } + + @Override + public SequenceServiceSettings build() throws IOException { + return new SequenceServiceSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java new file mode 100644 index 0000000000..9cf8b16a13 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java @@ -0,0 +1,880 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStub; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service to facilitate running discrete sets of tests against Showcase. + * + *

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

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

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingClient implements BackgroundResource { + private final TestingSettings settings; + private final TestingStub stub; + + /** Constructs an instance of TestingClient with default settings. */ + public static final TestingClient create() throws IOException { + return create(TestingSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient create(TestingSettings settings) throws IOException { + return new TestingClient(settings); + } + + /** + * Constructs an instance of TestingClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TestingSettings). + */ + public static final TestingClient create(TestingStub stub) { + return new TestingClient(stub); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient(TestingSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TestingStubSettings) settings.getStubSettings()).createStub(); + } + + protected TestingClient(TestingStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TestingSettings getSettings() { + return settings; + } + + public TestingStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   CreateSessionRequest request =
+   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
+   *   Session response = testingClient.createSession(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 Session createSession(CreateSessionRequest request) { + return createSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   GetSessionRequest request =
+   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
+   *   Session response = testingClient.getSession(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 Session getSession(GetSessionRequest request) { + return getSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   GetSessionRequest request =
+   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
+   *   ApiFuture future = testingClient.getSessionCallable().futureCall(request);
+   *   // Do something.
+   *   Session response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSessionCallable() { + return stub.getSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ListSessionsRequest request =
+   *       ListSessionsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Session element : testingClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { + return listSessionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ListSessionsRequest request =
+   *       ListSessionsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Session element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSessionsPagedCallable() { + return stub.listSessionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   DeleteSessionRequest request =
+   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
+   *   testingClient.deleteSession(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSession(DeleteSessionRequest request) { + deleteSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   DeleteSessionRequest request =
+   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
+   *   ApiFuture future = testingClient.deleteSessionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSessionCallable() { + return stub.deleteSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ReportSessionRequest request =
+   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
+   *   ReportSessionResponse response = testingClient.reportSession(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 ReportSessionResponse reportSession(ReportSessionRequest request) { + return reportSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ReportSessionRequest request =
+   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
+   *   ApiFuture future =
+   *       testingClient.reportSessionCallable().futureCall(request);
+   *   // Do something.
+   *   ReportSessionResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reportSessionCallable() { + return stub.reportSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ListTestsRequest request =
+   *       ListTestsRequest.newBuilder()
+   *           .setParent(SessionName.of("[SESSION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Test element : testingClient.listTests(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 ListTestsPagedResponse listTests(ListTestsRequest request) { + return listTestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ListTestsRequest request =
+   *       ListTestsRequest.newBuilder()
+   *           .setParent(SessionName.of("[SESSION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Test element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTestsPagedCallable() { + return stub.listTestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   ListTestsRequest request =
+   *       ListTestsRequest.newBuilder()
+   *           .setParent(SessionName.of("[SESSION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListTestsResponse response = testingClient.listTestsCallable().call(request);
+   *     for (Test element : response.getTestsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTestsCallable() { + return stub.listTestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

This method will error if attempting to delete a required test. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   DeleteTestRequest request =
+   *       DeleteTestRequest.newBuilder()
+   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
+   *           .build();
+   *   testingClient.deleteTest(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTest(DeleteTestRequest request) { + deleteTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

This method will error if attempting to delete a required test. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   DeleteTestRequest request =
+   *       DeleteTestRequest.newBuilder()
+   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
+   *           .build();
+   *   ApiFuture future = testingClient.deleteTestCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteTestCallable() { + return stub.deleteTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   VerifyTestRequest request =
+   *       VerifyTestRequest.newBuilder()
+   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
+   *           .setAnswer(ByteString.EMPTY)
+   *           .addAllAnswers(new ArrayList())
+   *           .build();
+   *   VerifyTestResponse response = testingClient.verifyTest(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 VerifyTestResponse verifyTest(VerifyTestRequest request) { + return verifyTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TestingClient testingClient = TestingClient.create()) {
+   *   VerifyTestRequest request =
+   *       VerifyTestRequest.newBuilder()
+   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
+   *           .setAnswer(ByteString.EMPTY)
+   *           .addAllAnswers(new ArrayList())
+   *           .build();
+   *   ApiFuture future = testingClient.verifyTestCallable().futureCall(request);
+   *   // Do something.
+   *   VerifyTestResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable verifyTestCallable() { + return stub.verifyTestCallable(); + } + + @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 ListSessionsPagedResponse + extends AbstractPagedListResponse< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSessionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSessionsPagedResponse(ListSessionsPage page) { + super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSessionsPage + extends AbstractPage { + + private ListSessionsPage( + PageContext context, + ListSessionsResponse response) { + super(context, response); + } + + private static ListSessionsPage createEmptyPage() { + return new ListSessionsPage(null, null); + } + + @Override + protected ListSessionsPage createPage( + PageContext context, + ListSessionsResponse response) { + return new ListSessionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSessionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + private ListSessionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSessionsFixedSizeCollection createEmptyCollection() { + return new ListSessionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSessionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSessionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListTestsPagedResponse + extends AbstractPagedListResponse< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListTestsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListTestsPagedResponse(ListTestsPage page) { + super(page, ListTestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTestsPage + extends AbstractPage { + + private ListTestsPage( + PageContext context, + ListTestsResponse response) { + super(context, response); + } + + private static ListTestsPage createEmptyPage() { + return new ListTestsPage(null, null); + } + + @Override + protected ListTestsPage createPage( + PageContext context, + ListTestsResponse response) { + return new ListTestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + private ListTestsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTestsFixedSizeCollection createEmptyCollection() { + return new ListTestsFixedSizeCollection(null, 0); + } + + @Override + protected ListTestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTestsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java new file mode 100644 index 0000000000..0a59e67a92 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -0,0 +1,286 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +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 TestingClient}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createSession to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder();
+ * testingSettingsBuilder
+ *     .createSessionSettings()
+ *     .setRetrySettings(
+ *         testingSettingsBuilder
+ *             .createSessionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TestingSettings testingSettings = testingSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return ((TestingStubSettings) getStubSettings()).createSessionSettings(); + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return ((TestingStubSettings) getStubSettings()).getSessionSettings(); + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return ((TestingStubSettings) getStubSettings()).listSessionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return ((TestingStubSettings) getStubSettings()).deleteSessionSettings(); + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return ((TestingStubSettings) getStubSettings()).reportSessionSettings(); + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return ((TestingStubSettings) getStubSettings()).listTestsSettings(); + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return ((TestingStubSettings) getStubSettings()).deleteTestSettings(); + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return ((TestingStubSettings) getStubSettings()).verifyTestSettings(); + } + + public static final TestingSettings create(TestingStubSettings stub) throws IOException { + return new TestingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TestingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TestingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TestingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TestingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TestingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return TestingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TestingStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TestingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TestingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TestingStubSettings.newBuilder(clientContext)); + } + + protected Builder(TestingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TestingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TestingStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(TestingStubSettings.newHttpJsonBuilder()); + } + + public TestingStubSettings.Builder getStubSettingsBuilder() { + return ((TestingStubSettings.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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return getStubSettingsBuilder().createSessionSettings(); + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getStubSettingsBuilder().getSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return getStubSettingsBuilder().listSessionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return getStubSettingsBuilder().deleteSessionSettings(); + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return getStubSettingsBuilder().reportSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return getStubSettingsBuilder().listTestsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return getStubSettingsBuilder().deleteTestSettings(); + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return getStubSettingsBuilder().verifyTestSettings(); + } + + @Override + public TestingSettings build() throws IOException { + return new TestingSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json new file mode 100644 index 0000000000..31f51f17ef --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json @@ -0,0 +1,210 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.showcase.v1beta1", + "libraryPackage": "com.google.showcase.v1beta1", + "services": { + "Compliance": { + "clients": { + "grpc": { + "libraryClient": "ComplianceClient", + "rpcs": { + "GetEnum": { + "methods": ["getEnum", "getEnumCallable"] + }, + "RepeatDataBody": { + "methods": ["repeatDataBody", "repeatDataBodyCallable"] + }, + "RepeatDataBodyInfo": { + "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] + }, + "RepeatDataBodyPatch": { + "methods": ["repeatDataBodyPatch", "repeatDataBodyPatchCallable"] + }, + "RepeatDataBodyPut": { + "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] + }, + "RepeatDataPathResource": { + "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] + }, + "RepeatDataPathTrailingResource": { + "methods": ["repeatDataPathTrailingResource", "repeatDataPathTrailingResourceCallable"] + }, + "RepeatDataQuery": { + "methods": ["repeatDataQuery", "repeatDataQueryCallable"] + }, + "RepeatDataSimplePath": { + "methods": ["repeatDataSimplePath", "repeatDataSimplePathCallable"] + }, + "VerifyEnum": { + "methods": ["verifyEnum", "verifyEnumCallable"] + } + } + } + } + }, + "Echo": { + "clients": { + "grpc": { + "libraryClient": "EchoClient", + "rpcs": { + "Block": { + "methods": ["block", "blockCallable"] + }, + "Chat": { + "methods": ["chatCallable"] + }, + "Collect": { + "methods": ["collectCallable"] + }, + "Echo": { + "methods": ["echo", "echoCallable"] + }, + "Expand": { + "methods": ["expandCallable"] + }, + "PagedExpand": { + "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] + }, + "PagedExpandLegacy": { + "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] + }, + "PagedExpandLegacyMapped": { + "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] + }, + "Wait": { + "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] + } + } + } + } + }, + "Identity": { + "clients": { + "grpc": { + "libraryClient": "IdentityClient", + "rpcs": { + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "ListUsers": { + "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUserCallable"] + } + } + } + } + }, + "Messaging": { + "clients": { + "grpc": { + "libraryClient": "MessagingClient", + "rpcs": { + "Connect": { + "methods": ["connectCallable"] + }, + "CreateBlurb": { + "methods": ["createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurbCallable"] + }, + "CreateRoom": { + "methods": ["createRoom", "createRoom", "createRoomCallable"] + }, + "DeleteBlurb": { + "methods": ["deleteBlurb", "deleteBlurb", "deleteBlurb", "deleteBlurbCallable"] + }, + "DeleteRoom": { + "methods": ["deleteRoom", "deleteRoom", "deleteRoom", "deleteRoomCallable"] + }, + "GetBlurb": { + "methods": ["getBlurb", "getBlurb", "getBlurb", "getBlurbCallable"] + }, + "GetRoom": { + "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] + }, + "ListBlurbs": { + "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] + }, + "ListRooms": { + "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] + }, + "SearchBlurbs": { + "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] + }, + "SendBlurbs": { + "methods": ["sendBlurbsCallable"] + }, + "StreamBlurbs": { + "methods": ["streamBlurbsCallable"] + }, + "UpdateBlurb": { + "methods": ["updateBlurb", "updateBlurbCallable"] + }, + "UpdateRoom": { + "methods": ["updateRoom", "updateRoomCallable"] + } + } + } + } + }, + "SequenceService": { + "clients": { + "grpc": { + "libraryClient": "SequenceServiceClient", + "rpcs": { + "AttemptSequence": { + "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] + }, + "CreateSequence": { + "methods": ["createSequence", "createSequence", "createSequenceCallable"] + }, + "GetSequenceReport": { + "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] + } + } + } + } + }, + "Testing": { + "clients": { + "grpc": { + "libraryClient": "TestingClient", + "rpcs": { + "CreateSession": { + "methods": ["createSession", "createSessionCallable"] + }, + "DeleteSession": { + "methods": ["deleteSession", "deleteSessionCallable"] + }, + "DeleteTest": { + "methods": ["deleteTest", "deleteTestCallable"] + }, + "GetSession": { + "methods": ["getSession", "getSessionCallable"] + }, + "ListSessions": { + "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] + }, + "ListTests": { + "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] + }, + "ReportSession": { + "methods": ["reportSession", "reportSessionCallable"] + }, + "VerifyTest": { + "methods": ["verifyTest", "verifyTestCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java new file mode 100644 index 0000000000..be1926a090 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java @@ -0,0 +1,162 @@ +/* + * 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 Client Libraries Showcase API + * + *

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

======================= ComplianceClient ======================= + * + *

Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

Sample for ComplianceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+ *   RepeatRequest request =
+ *       RepeatRequest.newBuilder()
+ *           .setName("name3373707")
+ *           .setInfo(ComplianceData.newBuilder().build())
+ *           .setServerVerify(true)
+ *           .setIntendedBindingUri("intendedBindingUri780142386")
+ *           .setFInt32(-1143775883)
+ *           .setFInt64(-1143775788)
+ *           .setFDouble(-1239459382)
+ *           .setPInt32(-858673665)
+ *           .setPInt64(-858673570)
+ *           .setPDouble(-991225216)
+ *           .build();
+ *   RepeatResponse response = complianceClient.repeatDataBody(request);
+ * }
+ * }
+ * + *

======================= EchoClient ======================= + * + *

Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

Sample for EchoClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ *   EchoRequest request =
+ *       EchoRequest.newBuilder()
+ *           .setSeverity(Severity.forNumber(0))
+ *           .setHeader("header-1221270899")
+ *           .setOtherHeader("otherHeader-2026585667")
+ *           .build();
+ *   EchoResponse response = echoClient.echo(request);
+ * }
+ * }
+ * + *

======================= IdentityClient ======================= + * + *

Service Description: A simple identity service. + * + *

Sample for IdentityClient: + * + *

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

======================= MessagingClient ======================= + * + *

Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

Sample for MessagingClient: + * + *

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

======================= SequenceServiceClient ======================= + * + *

Sample for SequenceServiceClient: + * + *

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

======================= TestingClient ======================= + * + *

Service Description: A service to facilitate running discrete sets of tests against Showcase. + * + *

Sample for TestingClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TestingClient testingClient = TestingClient.create()) {
+ *   CreateSessionRequest request =
+ *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
+ *   Session response = testingClient.createSession(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.showcase.v1beta1; + +import javax.annotation.Generated; diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java new file mode 100644 index 0000000000..c4f54eb557 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java @@ -0,0 +1,81 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Compliance service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ComplianceStub implements BackgroundResource { + + public UnaryCallable repeatDataBodyCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyCallable()"); + } + + public UnaryCallable repeatDataBodyInfoCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyInfoCallable()"); + } + + public UnaryCallable repeatDataQueryCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataQueryCallable()"); + } + + public UnaryCallable repeatDataSimplePathCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataSimplePathCallable()"); + } + + public UnaryCallable repeatDataPathResourceCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataPathResourceCallable()"); + } + + public UnaryCallable repeatDataPathTrailingResourceCallable() { + throw new UnsupportedOperationException( + "Not implemented: repeatDataPathTrailingResourceCallable()"); + } + + public UnaryCallable repeatDataBodyPutCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPutCallable()"); + } + + public UnaryCallable repeatDataBodyPatchCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPatchCallable()"); + } + + public UnaryCallable getEnumCallable() { + throw new UnsupportedOperationException("Not implemented: getEnumCallable()"); + } + + public UnaryCallable verifyEnumCallable() { + throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java new file mode 100644 index 0000000000..67b16b6fac --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -0,0 +1,526 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.ApiFunction; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 ComplianceStub}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 repeatDataBody to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder();
+ * complianceSettingsBuilder
+ *     .repeatDataBodySettings()
+ *     .setRetrySettings(
+ *         complianceSettingsBuilder
+ *             .repeatDataBodySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings repeatDataBodySettings; + private final UnaryCallSettings repeatDataBodyInfoSettings; + private final UnaryCallSettings repeatDataQuerySettings; + private final UnaryCallSettings repeatDataSimplePathSettings; + private final UnaryCallSettings repeatDataPathResourceSettings; + private final UnaryCallSettings + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings repeatDataBodyPutSettings; + private final UnaryCallSettings repeatDataBodyPatchSettings; + private final UnaryCallSettings getEnumSettings; + private final UnaryCallSettings verifyEnumSettings; + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return getEnumSettings; + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return verifyEnumSettings; + } + + public ComplianceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcComplianceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonComplianceStub.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 "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ComplianceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + repeatDataBodySettings = settingsBuilder.repeatDataBodySettings().build(); + repeatDataBodyInfoSettings = settingsBuilder.repeatDataBodyInfoSettings().build(); + repeatDataQuerySettings = settingsBuilder.repeatDataQuerySettings().build(); + repeatDataSimplePathSettings = settingsBuilder.repeatDataSimplePathSettings().build(); + repeatDataPathResourceSettings = settingsBuilder.repeatDataPathResourceSettings().build(); + repeatDataPathTrailingResourceSettings = + settingsBuilder.repeatDataPathTrailingResourceSettings().build(); + repeatDataBodyPutSettings = settingsBuilder.repeatDataBodyPutSettings().build(); + repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); + getEnumSettings = settingsBuilder.getEnumSettings().build(); + verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); + } + + /** Builder for ComplianceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder repeatDataBodySettings; + private final UnaryCallSettings.Builder + repeatDataBodyInfoSettings; + private final UnaryCallSettings.Builder repeatDataQuerySettings; + private final UnaryCallSettings.Builder + repeatDataSimplePathSettings; + private final UnaryCallSettings.Builder + repeatDataPathResourceSettings; + private final UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPutSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPatchSettings; + private final UnaryCallSettings.Builder getEnumSettings; + private final UnaryCallSettings.Builder verifyEnumSettings; + 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); + + repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataSimplePathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathTrailingResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings); + initDefaults(this); + } + + protected Builder(ComplianceStubSettings settings) { + super(settings); + + repeatDataBodySettings = settings.repeatDataBodySettings.toBuilder(); + repeatDataBodyInfoSettings = settings.repeatDataBodyInfoSettings.toBuilder(); + repeatDataQuerySettings = settings.repeatDataQuerySettings.toBuilder(); + repeatDataSimplePathSettings = settings.repeatDataSimplePathSettings.toBuilder(); + repeatDataPathResourceSettings = settings.repeatDataPathResourceSettings.toBuilder(); + repeatDataPathTrailingResourceSettings = + settings.repeatDataPathTrailingResourceSettings.toBuilder(); + repeatDataBodyPutSettings = settings.repeatDataBodyPutSettings.toBuilder(); + repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); + getEnumSettings = settings.getEnumSettings.toBuilder(); + verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .repeatDataBodySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataSimplePathSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathTrailingResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPatchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getEnumSettings; + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return verifyEnumSettings; + } + + @Override + public ComplianceStubSettings build() throws IOException { + return new ComplianceStubSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java new file mode 100644 index 0000000000..be6b33ec95 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -0,0 +1,116 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Echo service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class EchoStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable echoCallable() { + throw new UnsupportedOperationException("Not implemented: echoCallable()"); + } + + public ServerStreamingCallable expandCallable() { + throw new UnsupportedOperationException("Not implemented: expandCallable()"); + } + + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException("Not implemented: collectCallable()"); + } + + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException("Not implemented: chatCallable()"); + } + + public UnaryCallable pagedExpandPagedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandPagedCallable()"); + } + + public UnaryCallable pagedExpandCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandCallable()"); + } + + public UnaryCallable pagedExpandLegacyCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: pagedExpandLegacyMappedPagedCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyMappedCallable()"); + } + + public OperationCallable waitOperationCallable() { + throw new UnsupportedOperationException("Not implemented: waitOperationCallable()"); + } + + public UnaryCallable waitCallable() { + throw new UnsupportedOperationException("Not implemented: waitCallable()"); + } + + public UnaryCallable blockCallable() { + throw new UnsupportedOperationException("Not implemented: blockCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java new file mode 100644 index 0000000000..d4d038ddd4 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -0,0 +1,713 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoStub}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 echo to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
+ * echoSettingsBuilder
+ *     .echoSettings()
+ *     .setRetrySettings(
+ *         echoSettingsBuilder
+ *             .echoSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * EchoStubSettings echoSettings = echoSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings echoSettings; + private final ServerStreamingCallSettings expandSettings; + private final StreamingCallSettings collectSettings; + private final StreamingCallSettings chatSettings; + private final PagedCallSettings + pagedExpandSettings; + private final UnaryCallSettings + pagedExpandLegacySettings; + private final PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings waitSettings; + private final OperationCallSettings + waitOperationSettings; + private final UnaryCallSettings blockSettings; + + private static final PagedListDescriptor + PAGED_EXPAND_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(PagedExpandResponse payload) { + return payload.getResponsesList() == null + ? ImmutableList.of() + : payload.getResponsesList(); + } + }; + + private static final PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC = + new PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandLegacyMappedResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable> extractResources( + PagedExpandLegacyMappedResponse payload) { + return payload.getAlphabetizedMap() == null + ? Collections.>emptySet() + : payload.getAlphabetizedMap().entrySet(); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + PAGED_EXPAND_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); + return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + pageContext = + PageContext.create( + callable, PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC, request, context); + return PagedExpandLegacyMappedPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return echoSettings; + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return expandSettings; + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return collectSettings; + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return chatSettings; + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return waitSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return blockSettings; + } + + public EchoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEchoStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEchoStub.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 "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected EchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoSettings = settingsBuilder.echoSettings().build(); + expandSettings = settingsBuilder.expandSettings().build(); + collectSettings = settingsBuilder.collectSettings().build(); + chatSettings = settingsBuilder.chatSettings().build(); + pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); + pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); + pagedExpandLegacyMappedSettings = settingsBuilder.pagedExpandLegacyMappedSettings().build(); + waitSettings = settingsBuilder.waitSettings().build(); + waitOperationSettings = settingsBuilder.waitOperationSettings().build(); + blockSettings = settingsBuilder.blockSettings().build(); + } + + /** Builder for EchoStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder echoSettings; + private final ServerStreamingCallSettings.Builder expandSettings; + private final StreamingCallSettings.Builder collectSettings; + private final StreamingCallSettings.Builder chatSettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings; + private final UnaryCallSettings.Builder + pagedExpandLegacySettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings.Builder waitSettings; + private final OperationCallSettings.Builder + waitOperationSettings; + private final UnaryCallSettings.Builder blockSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setInitialRpcTimeout(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(10000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + expandSettings = ServerStreamingCallSettings.newBuilder(); + collectSettings = StreamingCallSettings.newBuilder(); + chatSettings = StreamingCallSettings.newBuilder(); + pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); + pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pagedExpandLegacyMappedSettings = + PagedCallSettings.newBuilder(PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT); + waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + waitOperationSettings = OperationCallSettings.newBuilder(); + blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings); + initDefaults(this); + } + + protected Builder(EchoStubSettings settings) { + super(settings); + + echoSettings = settings.echoSettings.toBuilder(); + expandSettings = settings.expandSettings.toBuilder(); + collectSettings = settings.collectSettings.toBuilder(); + chatSettings = settings.chatSettings.toBuilder(); + pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); + pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); + pagedExpandLegacyMappedSettings = settings.pagedExpandLegacyMappedSettings.toBuilder(); + waitSettings = settings.waitSettings.toBuilder(); + waitOperationSettings = settings.waitOperationSettings.toBuilder(); + blockSettings = settings.blockSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .echoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .expandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandLegacySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pagedExpandLegacyMappedSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .blockSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return echoSettings; + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return expandSettings; + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return collectSettings; + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return chatSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return waitSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return blockSettings; + } + + @Override + public EchoStubSettings build() throws IOException { + return new EchoStubSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java new file mode 100644 index 0000000000..953ca5555b --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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 Compliance service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java new file mode 100644 index 0000000000..116d0fa5cb --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java @@ -0,0 +1,397 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Compliance service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceStub extends ComplianceStub { + private static final MethodDescriptor + repeatDataBodyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataBodyInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataSimplePathMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataPathResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataBodyPutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + repeatDataBodyPatchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor verifyEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new GrpcComplianceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcComplianceStub create(ClientContext clientContext) throws IOException { + return new GrpcComplianceStub(ComplianceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcComplianceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcComplianceStub( + ComplianceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcComplianceCallableFactory()); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings repeatDataBodyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .build(); + GrpcCallSettings repeatDataQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .build(); + GrpcCallSettings repeatDataSimplePathTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("info.f_bool", String.valueOf(request.getInfo().getFBool())); + params.put("info.f_double", String.valueOf(request.getInfo().getFDouble())); + params.put("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + params.put("info.f_kingdom", String.valueOf(request.getInfo().getFKingdom())); + params.put("info.f_string", String.valueOf(request.getInfo().getFString())); + return params.build(); + }) + .build(); + GrpcCallSettings repeatDataPathResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("info.f_bool", String.valueOf(request.getInfo().getFBool())); + params.put( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + params.put("info.f_string", String.valueOf(request.getInfo().getFString())); + return params.build(); + }) + .build(); + GrpcCallSettings + repeatDataPathTrailingResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + params.put("info.f_string", String.valueOf(request.getInfo().getFString())); + return params.build(); + }) + .build(); + GrpcCallSettings repeatDataBodyPutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyPatchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .build(); + GrpcCallSettings getEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .build(); + GrpcCallSettings verifyEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java new file mode 100644 index 0000000000..3306812933 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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 Echo service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java new file mode 100644 index 0000000000..3e8a99d5b2 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java @@ -0,0 +1,413 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Echo service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoStub extends EchoStub { + private static final MethodDescriptor echoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor expandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor collectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Collect") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor chatMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Chat") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + pagedExpandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setRequestMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyMappedResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor waitMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor blockMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable echoCallable; + private final ServerStreamingCallable expandCallable; + private final ClientStreamingCallable collectCallable; + private final BidiStreamingCallable chatCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final GrpcEchoStub create(EchoStubSettings settings) throws IOException { + return new GrpcEchoStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEchoStub create(ClientContext clientContext) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEchoStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcEchoCallableFactory()); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings echoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings expandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .build(); + GrpcCallSettings collectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectMethodDescriptor) + .build(); + GrpcCallSettings chatTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(chatMethodDescriptor) + .build(); + GrpcCallSettings pagedExpandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyMappedTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .build(); + GrpcCallSettings waitTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .build(); + GrpcCallSettings blockTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.collectCallable = + callableFactory.createClientStreamingCallable( + collectTransportSettings, settings.collectSettings(), clientContext); + this.chatCallable = + callableFactory.createBidiStreamingCallable( + chatTransportSettings, settings.chatSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, settings.waitOperationSettings(), clientContext, operationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + return collectCallable; + } + + @Override + public BidiStreamingCallable chatCallable() { + return chatCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java new file mode 100644 index 0000000000..313391c0ee --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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 Identity service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java new file mode 100644 index 0000000000..516fe97b2b --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java @@ -0,0 +1,272 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Identity service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityStub extends IdentityStub { + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcIdentityStub create(IdentityStubSettings settings) throws IOException { + return new GrpcIdentityStub(settings, ClientContext.create(settings)); + } + + public static final GrpcIdentityStub create(ClientContext clientContext) throws IOException { + return new GrpcIdentityStub(IdentityStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcIdentityStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcIdentityStub( + IdentityStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcIdentityCallableFactory()); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("user.name", String.valueOf(request.getUser().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java new file mode 100644 index 0000000000..82e36cdcdf --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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 Messaging service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java new file mode 100644 index 0000000000..91be592df1 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java @@ -0,0 +1,562 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Messaging service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingStub extends MessagingStub { + private static final MethodDescriptor createRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setRequestMarshaller(ProtoUtils.marshaller(GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRoomsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setRequestMarshaller(ProtoUtils.marshaller(ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListRoomsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListBlurbsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + sendBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/SendBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SendBlurbsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + connectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/Connect") + .setRequestMarshaller(ProtoUtils.marshaller(ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final ClientStreamingCallable sendBlurbsCallable; + private final BidiStreamingCallable connectCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMessagingStub create(MessagingStubSettings settings) throws IOException { + return new GrpcMessagingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMessagingStub create(ClientContext clientContext) throws IOException { + return new GrpcMessagingStub(MessagingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMessagingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMessagingStub( + MessagingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMessagingCallableFactory()); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .build(); + GrpcCallSettings getRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("room.name", String.valueOf(request.getRoom().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listRoomsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .build(); + GrpcCallSettings createBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("blurb.name", String.valueOf(request.getBlurb().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings searchBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings streamBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings sendBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(sendBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings connectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(connectMethodDescriptor) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + operationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.sendBlurbsCallable = + callableFactory.createClientStreamingCallable( + sendBlurbsTransportSettings, settings.sendBlurbsSettings(), clientContext); + this.connectCallable = + callableFactory.createBidiStreamingCallable( + connectTransportSettings, settings.connectSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + return sendBlurbsCallable; + } + + @Override + public BidiStreamingCallable connectCallable() { + return connectCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..b7ed163bf7 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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 SequenceService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java new file mode 100644 index 0000000000..9f34118467 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SequenceService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceStub extends SequenceServiceStub { + private static final MethodDescriptor + createSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Sequence.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SequenceReport.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + attemptSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new GrpcSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSequenceServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .build(); + GrpcCallSettings getSequenceReportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings attemptSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java new file mode 100644 index 0000000000..d117701765 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +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 Testing service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java new file mode 100644 index 0000000000..0787a31179 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java @@ -0,0 +1,378 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Testing service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingStub extends TestingStub { + private static final MethodDescriptor + createSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSessionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + reportSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setRequestMarshaller( + ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listTestsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + verifyTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTestingStub create(TestingStubSettings settings) throws IOException { + return new GrpcTestingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTestingStub create(ClientContext clientContext) throws IOException { + return new GrpcTestingStub(TestingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTestingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTestingStub( + TestingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTestingCallableFactory()); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .build(); + GrpcCallSettings getSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listSessionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .build(); + GrpcCallSettings deleteSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings reportSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listTestsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings verifyTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java new file mode 100644 index 0000000000..ae83f1e131 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Compliance service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java new file mode 100644 index 0000000000..5fd2556f89 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java @@ -0,0 +1,772 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Compliance service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceStub extends ComplianceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + repeatDataBodyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:body", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyinfo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("info", request.getInfo(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:query", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataSimplePathMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString}/{info.fInt32}/{info.fDouble}/{info.fBool}/{info.fKingdom}:simplepath", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, "info.fDouble", request.getInfo().getFDouble()); + serializer.putPathParam( + fields, "info.fInt32", request.getInfo().getFInt32()); + serializer.putPathParam( + fields, "info.fKingdom", request.getInfo().getFKingdomValue()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/*}/bool/{info.fBool}:pathresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/repeat/{info.fChild.fString=first/*}/{info.fString=second/*}/bool/{info.fBool}:childfirstpathresource") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/**}:pathtrailingresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPutMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyput", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodypatch", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor verifyEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "continent", request.getContinentValue()); + serializer.putQueryParam(fields, "request", request.getRequest()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new HttpJsonComplianceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonComplianceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonComplianceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonComplianceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings repeatDataBodyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataSimplePathTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataPathResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + repeatDataPathTrailingResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyPutTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyPatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings verifyEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(repeatDataBodyMethodDescriptor); + methodDescriptors.add(repeatDataBodyInfoMethodDescriptor); + methodDescriptors.add(repeatDataQueryMethodDescriptor); + methodDescriptors.add(repeatDataSimplePathMethodDescriptor); + methodDescriptors.add(repeatDataPathResourceMethodDescriptor); + methodDescriptors.add(repeatDataPathTrailingResourceMethodDescriptor); + methodDescriptors.add(repeatDataBodyPutMethodDescriptor); + methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); + methodDescriptors.add(getEnumMethodDescriptor); + methodDescriptors.add(verifyEnumMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java new file mode 100644 index 0000000000..0702689af2 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Echo service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java new file mode 100644 index 0000000000..3ddb5d3570 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java @@ -0,0 +1,562 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Echo service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoStub extends EchoStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WaitResponse.getDescriptor()) + .add(WaitMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor echoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:echo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor expandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:expand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacyMapped", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandLegacyMappedResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor waitMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:wait", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (WaitRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor blockMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:block", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BlockResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable echoCallable; + private final ServerStreamingCallable expandCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { + return new HttpJsonEchoStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { + return new HttpJsonEchoStub(EchoStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonEchoStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEchoStub( + EchoStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonEchoCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings echoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings expandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pagedExpandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyMappedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings waitTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings blockTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, + settings.waitOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(echoMethodDescriptor); + methodDescriptors.add(expandMethodDescriptor); + methodDescriptors.add(pagedExpandMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); + methodDescriptors.add(waitMethodDescriptor); + methodDescriptors.add(blockMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java new file mode 100644 index 0000000000..b8766ddbcd --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Identity service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java new file mode 100644 index 0000000000..528858e711 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java @@ -0,0 +1,406 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Identity service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityStub extends IdentityStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{user.name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonIdentityStub create(IdentityStubSettings settings) + throws IOException { + return new HttpJsonIdentityStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonIdentityStub create(ClientContext clientContext) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonIdentityStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonIdentityCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java new file mode 100644 index 0000000000..f56157bdd4 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Messaging service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java new file mode 100644 index 0000000000..41ac603817 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java @@ -0,0 +1,823 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Messaging service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingStub extends MessagingStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(SearchBlurbsResponse.getDescriptor()) + .add(SearchBlurbsMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor createRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{room.name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "room.name", request.getRoom().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("room", request.getRoom(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRoomsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRoomsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{blurb.name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "blurb.name", request.getBlurb().getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{blurb.name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs:search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs:search") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SearchBlurbsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + streamBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}/blurbs:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile}/blurbs:stream") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMessagingStub create(MessagingStubSettings settings) + throws IOException { + return new HttpJsonMessagingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMessagingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMessagingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMessagingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listRoomsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings searchBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings streamBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createRoomMethodDescriptor); + methodDescriptors.add(getRoomMethodDescriptor); + methodDescriptors.add(updateRoomMethodDescriptor); + methodDescriptors.add(deleteRoomMethodDescriptor); + methodDescriptors.add(listRoomsMethodDescriptor); + methodDescriptors.add(createBlurbMethodDescriptor); + methodDescriptors.add(getBlurbMethodDescriptor); + methodDescriptors.add(updateBlurbMethodDescriptor); + methodDescriptors.add(deleteBlurbMethodDescriptor); + methodDescriptors.add(listBlurbsMethodDescriptor); + methodDescriptors.add(searchBlurbsMethodDescriptor); + methodDescriptors.add(streamBlurbsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..dc37c46e8a --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SequenceService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java new file mode 100644 index 0000000000..c2522b9648 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java @@ -0,0 +1,302 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SequenceService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceStub extends SequenceServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sequence", request.getSequence(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Sequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSequenceReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*/sequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + attemptSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new HttpJsonSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSequenceServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getSequenceReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings attemptSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSequenceMethodDescriptor); + methodDescriptors.add(getSequenceReportMethodDescriptor); + methodDescriptors.add(attemptSequenceMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java new file mode 100644 index 0000000000..c33422c6ae --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.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.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Testing service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java new file mode 100644 index 0000000000..eb1a664bb0 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java @@ -0,0 +1,572 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Testing service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingStub extends TestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("session", request.getSession(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSessionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + reportSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}:report", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReportSessionResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listTestsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=sessions/*}/tests", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTestsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + verifyTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}:check", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "answer", request.getAnswer()); + serializer.putQueryParam(fields, "answers", request.getAnswersList()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonTestingStub create(TestingStubSettings settings) throws IOException { + return new HttpJsonTestingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTestingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTestingStub(TestingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTestingStub( + TestingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listSessionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + reportSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listTestsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings verifyTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSessionMethodDescriptor); + methodDescriptors.add(getSessionMethodDescriptor); + methodDescriptors.add(listSessionsMethodDescriptor); + methodDescriptors.add(deleteSessionMethodDescriptor); + methodDescriptors.add(reportSessionMethodDescriptor); + methodDescriptors.add(listTestsMethodDescriptor); + methodDescriptors.add(deleteTestMethodDescriptor); + methodDescriptors.add(verifyTestMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java new file mode 100644 index 0000000000..b09d5c635e --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java @@ -0,0 +1,70 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Identity service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class IdentityStub implements BackgroundResource { + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java new file mode 100644 index 0000000000..92aaa1133d --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -0,0 +1,491 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 IdentityStub}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createUser to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder();
+ * identitySettingsBuilder
+ *     .createUserSettings()
+ *     .setRetrySettings(
+ *         identitySettingsBuilder
+ *             .createUserSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * IdentityStubSettings identitySettings = identitySettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentityStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; + private final PagedCallSettings + listUsersSettings; + + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList() == null + ? ImmutableList.of() + : payload.getUsersList(); + } + }; + + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + public IdentityStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcIdentityStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonIdentityStub.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 "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected IdentityStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createUserSettings = settingsBuilder.createUserSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + } + + /** Builder for IdentityStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(200L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings); + initDefaults(this); + } + + protected Builder(IdentityStubSettings settings) { + super(settings); + + createUserSettings = settings.createUserSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + 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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + @Override + public IdentityStubSettings build() throws IOException { + return new IdentityStubSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java new file mode 100644 index 0000000000..50372c599b --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java @@ -0,0 +1,144 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Messaging service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MessagingStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable createRoomCallable() { + throw new UnsupportedOperationException("Not implemented: createRoomCallable()"); + } + + public UnaryCallable getRoomCallable() { + throw new UnsupportedOperationException("Not implemented: getRoomCallable()"); + } + + public UnaryCallable updateRoomCallable() { + throw new UnsupportedOperationException("Not implemented: updateRoomCallable()"); + } + + public UnaryCallable deleteRoomCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRoomCallable()"); + } + + public UnaryCallable listRoomsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsPagedCallable()"); + } + + public UnaryCallable listRoomsCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsCallable()"); + } + + public UnaryCallable createBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: createBlurbCallable()"); + } + + public UnaryCallable getBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: getBlurbCallable()"); + } + + public UnaryCallable updateBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: updateBlurbCallable()"); + } + + public UnaryCallable deleteBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBlurbCallable()"); + } + + public UnaryCallable listBlurbsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsPagedCallable()"); + } + + public UnaryCallable listBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsCallable()"); + } + + public OperationCallable + searchBlurbsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsOperationCallable()"); + } + + public UnaryCallable searchBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsCallable()"); + } + + public ServerStreamingCallable streamBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: streamBlurbsCallable()"); + } + + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: sendBlurbsCallable()"); + } + + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException("Not implemented: connectCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java new file mode 100644 index 0000000000..326883942f --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -0,0 +1,815 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 MessagingStub}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createRoom to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
+ * messagingSettingsBuilder
+ *     .createRoomSettings()
+ *     .setRetrySettings(
+ *         messagingSettingsBuilder
+ *             .createRoomSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createRoomSettings; + private final UnaryCallSettings getRoomSettings; + private final UnaryCallSettings updateRoomSettings; + private final UnaryCallSettings deleteRoomSettings; + private final PagedCallSettings + listRoomsSettings; + private final UnaryCallSettings createBlurbSettings; + private final UnaryCallSettings getBlurbSettings; + private final UnaryCallSettings updateBlurbSettings; + private final UnaryCallSettings deleteBlurbSettings; + private final PagedCallSettings + listBlurbsSettings; + private final UnaryCallSettings searchBlurbsSettings; + private final OperationCallSettings< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings + streamBlurbsSettings; + private final StreamingCallSettings sendBlurbsSettings; + private final StreamingCallSettings connectSettings; + + private static final PagedListDescriptor + LIST_ROOMS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRoomsRequest injectToken(ListRoomsRequest payload, String token) { + return ListRoomsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRoomsRequest injectPageSize(ListRoomsRequest payload, int pageSize) { + return ListRoomsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRoomsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRoomsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRoomsResponse payload) { + return payload.getRoomsList() == null + ? ImmutableList.of() + : payload.getRoomsList(); + } + }; + + private static final PagedListDescriptor + LIST_BLURBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBlurbsRequest injectToken(ListBlurbsRequest payload, String token) { + return ListBlurbsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBlurbsRequest injectPageSize(ListBlurbsRequest payload, int pageSize) { + return ListBlurbsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBlurbsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBlurbsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBlurbsResponse payload) { + return payload.getBlurbsList() == null + ? ImmutableList.of() + : payload.getBlurbsList(); + } + }; + + private static final PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + LIST_ROOMS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRoomsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ROOMS_PAGE_STR_DESC, request, context); + return ListRoomsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + LIST_BLURBS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBlurbsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BLURBS_PAGE_STR_DESC, request, context); + return ListBlurbsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return createRoomSettings; + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return getRoomSettings; + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return connectSettings; + } + + public MessagingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMessagingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMessagingStub.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 "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MessagingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createRoomSettings = settingsBuilder.createRoomSettings().build(); + getRoomSettings = settingsBuilder.getRoomSettings().build(); + updateRoomSettings = settingsBuilder.updateRoomSettings().build(); + deleteRoomSettings = settingsBuilder.deleteRoomSettings().build(); + listRoomsSettings = settingsBuilder.listRoomsSettings().build(); + createBlurbSettings = settingsBuilder.createBlurbSettings().build(); + getBlurbSettings = settingsBuilder.getBlurbSettings().build(); + updateBlurbSettings = settingsBuilder.updateBlurbSettings().build(); + deleteBlurbSettings = settingsBuilder.deleteBlurbSettings().build(); + listBlurbsSettings = settingsBuilder.listBlurbsSettings().build(); + searchBlurbsSettings = settingsBuilder.searchBlurbsSettings().build(); + searchBlurbsOperationSettings = settingsBuilder.searchBlurbsOperationSettings().build(); + streamBlurbsSettings = settingsBuilder.streamBlurbsSettings().build(); + sendBlurbsSettings = settingsBuilder.sendBlurbsSettings().build(); + connectSettings = settingsBuilder.connectSettings().build(); + } + + /** Builder for MessagingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createRoomSettings; + private final UnaryCallSettings.Builder getRoomSettings; + private final UnaryCallSettings.Builder updateRoomSettings; + private final UnaryCallSettings.Builder deleteRoomSettings; + private final PagedCallSettings.Builder< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + listRoomsSettings; + private final UnaryCallSettings.Builder createBlurbSettings; + private final UnaryCallSettings.Builder getBlurbSettings; + private final UnaryCallSettings.Builder updateBlurbSettings; + private final UnaryCallSettings.Builder deleteBlurbSettings; + private final PagedCallSettings.Builder< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + listBlurbsSettings; + private final UnaryCallSettings.Builder searchBlurbsSettings; + private final OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings.Builder + streamBlurbsSettings; + private final StreamingCallSettings.Builder + sendBlurbsSettings; + private final StreamingCallSettings.Builder + connectSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setInitialRpcTimeout(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(10000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRoomsSettings = PagedCallSettings.newBuilder(LIST_ROOMS_PAGE_STR_FACT); + createBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBlurbsSettings = PagedCallSettings.newBuilder(LIST_BLURBS_PAGE_STR_FACT); + searchBlurbsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + searchBlurbsOperationSettings = OperationCallSettings.newBuilder(); + streamBlurbsSettings = ServerStreamingCallSettings.newBuilder(); + sendBlurbsSettings = StreamingCallSettings.newBuilder(); + connectSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings); + initDefaults(this); + } + + protected Builder(MessagingStubSettings settings) { + super(settings); + + createRoomSettings = settings.createRoomSettings.toBuilder(); + getRoomSettings = settings.getRoomSettings.toBuilder(); + updateRoomSettings = settings.updateRoomSettings.toBuilder(); + deleteRoomSettings = settings.deleteRoomSettings.toBuilder(); + listRoomsSettings = settings.listRoomsSettings.toBuilder(); + createBlurbSettings = settings.createBlurbSettings.toBuilder(); + getBlurbSettings = settings.getBlurbSettings.toBuilder(); + updateBlurbSettings = settings.updateBlurbSettings.toBuilder(); + deleteBlurbSettings = settings.deleteBlurbSettings.toBuilder(); + listBlurbsSettings = settings.listBlurbsSettings.toBuilder(); + searchBlurbsSettings = settings.searchBlurbsSettings.toBuilder(); + searchBlurbsOperationSettings = settings.searchBlurbsOperationSettings.toBuilder(); + streamBlurbsSettings = settings.streamBlurbsSettings.toBuilder(); + sendBlurbsSettings = settings.sendBlurbsSettings.toBuilder(); + connectSettings = settings.connectSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listRoomsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .searchBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .streamBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .searchBlurbsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SearchBlurbsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SearchBlurbsMetadata.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return createRoomSettings; + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getRoomSettings; + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return connectSettings; + } + + @Override + public MessagingStubSettings build() throws IOException { + return new MessagingStubSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java new file mode 100644 index 0000000000..7b2f12a463 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SequenceService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SequenceServiceStub implements BackgroundResource { + + public UnaryCallable createSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createSequenceCallable()"); + } + + public UnaryCallable getSequenceReportCallable() { + throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); + } + + public UnaryCallable attemptSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java new file mode 100644 index 0000000000..8a4e8b0151 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -0,0 +1,387 @@ +/* + * 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.showcase.v1beta1.stub; + +import com.google.api.core.ApiFunction; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +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 SequenceServiceStub}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createSequence to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder =
+ *     SequenceServiceStubSettings.newBuilder();
+ * sequenceServiceSettingsBuilder
+ *     .createSequenceSettings()
+ *     .setRetrySettings(
+ *         sequenceServiceSettingsBuilder
+ *             .createSequenceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSequenceSettings; + private final UnaryCallSettings + getSequenceReportSettings; + private final UnaryCallSettings attemptSequenceSettings; + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return attemptSequenceSettings; + } + + public SequenceServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSequenceServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSequenceServiceStub.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 "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SequenceServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSequenceSettings = settingsBuilder.createSequenceSettings().build(); + getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); + attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); + } + + /** Builder for SequenceServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSequenceSettings; + private final UnaryCallSettings.Builder + getSequenceReportSettings; + private final UnaryCallSettings.Builder attemptSequenceSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setInitialRpcTimeout(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(10000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, getSequenceReportSettings, attemptSequenceSettings); + initDefaults(this); + } + + protected Builder(SequenceServiceStubSettings settings) { + super(settings); + + createSequenceSettings = settings.createSequenceSettings.toBuilder(); + getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); + attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, getSequenceReportSettings, attemptSequenceSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .attemptSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + 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 createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return attemptSequenceSettings; + } + + @Override + public SequenceServiceStubSettings build() throws IOException { + return new SequenceServiceStubSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java new file mode 100644 index 0000000000..5a79303508 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java @@ -0,0 +1,93 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Testing service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class TestingStub implements BackgroundResource { + + public UnaryCallable createSessionCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); + } + + public UnaryCallable getSessionCallable() { + throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); + } + + public UnaryCallable listSessionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); + } + + public UnaryCallable listSessionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); + } + + public UnaryCallable deleteSessionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); + } + + public UnaryCallable reportSessionCallable() { + throw new UnsupportedOperationException("Not implemented: reportSessionCallable()"); + } + + public UnaryCallable listTestsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsPagedCallable()"); + } + + public UnaryCallable listTestsCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsCallable()"); + } + + public UnaryCallable deleteTestCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTestCallable()"); + } + + public UnaryCallable verifyTestCallable() { + throw new UnsupportedOperationException("Not implemented: verifyTestCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java new file mode 100644 index 0000000000..9c22b1ce81 --- /dev/null +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -0,0 +1,612 @@ +/* + * 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.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 TestingStub}. + * + *

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

    + *
  • The default service address (localhost) and default port (7469) 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 createSession to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder();
+ * testingSettingsBuilder
+ *     .createSessionSettings()
+ *     .setRetrySettings(
+ *         testingSettingsBuilder
+ *             .createSessionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TestingStubSettings testingSettings = testingSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSessionSettings; + private final UnaryCallSettings getSessionSettings; + private final PagedCallSettings< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings deleteSessionSettings; + private final UnaryCallSettings + reportSessionSettings; + private final PagedCallSettings + listTestsSettings; + private final UnaryCallSettings deleteTestSettings; + private final UnaryCallSettings verifyTestSettings; + + private static final PagedListDescriptor + LIST_SESSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { + return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { + return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSessionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSessionsResponse payload) { + return payload.getSessionsList() == null + ? ImmutableList.of() + : payload.getSessionsList(); + } + }; + + private static final PagedListDescriptor + LIST_TESTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTestsRequest injectToken(ListTestsRequest payload, String token) { + return ListTestsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTestsRequest injectPageSize(ListTestsRequest payload, int pageSize) { + return ListTestsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTestsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTestsResponse payload) { + return payload.getTestsList() == null + ? ImmutableList.of() + : payload.getTestsList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + LIST_SESSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSessionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); + return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + LIST_TESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTestsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TESTS_PAGE_STR_DESC, request, context); + return ListTestsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return createSessionSettings; + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return getSessionSettings; + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return verifyTestSettings; + } + + public TestingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTestingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTestingStub.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 "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TestingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSessionSettings = settingsBuilder.createSessionSettings().build(); + getSessionSettings = settingsBuilder.getSessionSettings().build(); + listSessionsSettings = settingsBuilder.listSessionsSettings().build(); + deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); + reportSessionSettings = settingsBuilder.reportSessionSettings().build(); + listTestsSettings = settingsBuilder.listTestsSettings().build(); + deleteTestSettings = settingsBuilder.deleteTestSettings().build(); + verifyTestSettings = settingsBuilder.verifyTestSettings().build(); + } + + /** Builder for TestingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSessionSettings; + private final UnaryCallSettings.Builder getSessionSettings; + private final PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings.Builder deleteSessionSettings; + private final UnaryCallSettings.Builder + reportSessionSettings; + private final PagedCallSettings.Builder< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + listTestsSettings; + private final UnaryCallSettings.Builder deleteTestSettings; + private final UnaryCallSettings.Builder + verifyTestSettings; + 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); + + createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); + deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reportSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listTestsSettings = PagedCallSettings.newBuilder(LIST_TESTS_PAGE_STR_FACT); + deleteTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings); + initDefaults(this); + } + + protected Builder(TestingStubSettings settings) { + super(settings); + + createSessionSettings = settings.createSessionSettings.toBuilder(); + getSessionSettings = settings.getSessionSettings.toBuilder(); + listSessionsSettings = settings.listSessionsSettings.toBuilder(); + deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); + reportSessionSettings = settings.reportSessionSettings.toBuilder(); + listTestsSettings = settings.listTestsSettings.toBuilder(); + deleteTestSettings = settings.deleteTestSettings.toBuilder(); + verifyTestSettings = settings.verifyTestSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSessionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .reportSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listTestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return createSessionSettings; + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getSessionSettings; + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return verifyTestSettings; + } + + @Override + public TestingStubSettings build() throws IOException { + return new TestingStubSettings(this); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java new file mode 100644 index 0000000000..e2498246af --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java @@ -0,0 +1,917 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; +import java.io.IOException; +import java.util.List; +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 ComplianceClientHttpJsonTest { + private static MockHttpService mockService; + private static ComplianceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonComplianceStub.getMethodDescriptors(), ComplianceSettings.getDefaultEndpoint()); + ComplianceSettings settings = + ComplianceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java new file mode 100644 index 0000000000..219b1c3712 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java @@ -0,0 +1,740 @@ +/* + * 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.showcase.v1beta1; + +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.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ComplianceClientTest { + private static MockCompliance mockCompliance; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ComplianceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompliance = new MockCompliance(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCompliance)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ComplianceSettings settings = + ComplianceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumRequest actualRequest = ((EnumRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUnknownEnum(), actualRequest.getUnknownEnum()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumResponse actualRequest = ((EnumResponse) actualRequests.get(0)); + + Assert.assertEquals(request.getRequest(), actualRequest.getRequest()); + Assert.assertEquals(request.getContinent(), actualRequest.getContinent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java new file mode 100644 index 0000000000..c3084bda5f --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java @@ -0,0 +1,431 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.showcase.v1beta1.stub.HttpJsonEchoStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +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 EchoClientHttpJsonTest { + private static MockHttpService mockService; + private static EchoClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonEchoStub.getMethodDescriptors(), EchoSettings.getDefaultEndpoint()); + EchoSettings settings = + EchoSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception {} + + @Test + public void expandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void collectUnsupportedMethodTest() throws Exception { + // The collect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void chatUnsupportedMethodTest() throws Exception { + // The chat() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void waitExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockService.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void blockExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java new file mode 100644 index 0000000000..9f6f7f128c --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java @@ -0,0 +1,562 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +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.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +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 EchoClientTest { + private static MockEcho mockEcho; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private EchoClient client; + + @BeforeClass + public static void startStaticServer() { + mockEcho = new MockEcho(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockEcho)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + EchoSettings settings = + EchoSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .build(); + mockEcho.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoRequest actualRequest = ((EchoRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSeverity(), actualRequest.getSeverity()); + Assert.assertEquals(request.getHeader(), actualRequest.getHeader()); + Assert.assertEquals(request.getOtherHeader(), actualRequest.getOtherHeader()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .build(); + mockEcho.addResponse(expectedResponse); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void expandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void collectTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void collectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void chatTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void chatExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEcho.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WaitRequest actualRequest = ((WaitRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEndTime(), actualRequest.getEndTime()); + Assert.assertEquals(request.getTtl(), actualRequest.getTtl()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void waitExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockEcho.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BlockRequest actualRequest = ((BlockRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResponseDelay(), actualRequest.getResponseDelay()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void blockExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java new file mode 100644 index 0000000000..8928792040 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java @@ -0,0 +1,520 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonIdentityStub; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +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 IdentityClientHttpJsonTest { + private static MockHttpService mockService; + private static IdentityClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonIdentityStub.getMethodDescriptors(), IdentitySettings.getDefaultEndpoint()); + IdentitySettings settings = + IdentitySettings.newHttpJsonBuilder() + .setTransportChannelProvider( + IdentitySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java new file mode 100644 index 0000000000..acbfbedb75 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java @@ -0,0 +1,462 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class IdentityClientTest { + private static MockIdentity mockIdentity; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private IdentityClient client; + + @BeforeClass + public static void startStaticServer() { + mockIdentity = new MockIdentity(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockIdentity)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + IdentitySettings settings = + IdentitySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertEquals(age, actualRequest.getUser().getAge()); + Assert.assertEquals(nickname, actualRequest.getUser().getNickname()); + Assert.assertEquals(enableNotifications, actualRequest.getUser().getEnableNotifications()); + Assert.assertEquals(heightFeet, actualRequest.getUser().getHeightFeet(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUser(), actualRequest.getUser()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockIdentity.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java new file mode 100644 index 0000000000..de062e07f3 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java @@ -0,0 +1,1649 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonMessagingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MessagingClientHttpJsonTest { + private static MockHttpService mockService; + private static MessagingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMessagingStub.getMethodDescriptors(), MessagingSettings.getDefaultEndpoint()); + MessagingSettings settings = + MessagingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MessagingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRoomsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "rooms/room-4889"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void streamBlurbsTest() throws Exception {} + + @Test + public void streamBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void sendBlurbsUnsupportedMethodTest() throws Exception { + // The sendBlurbs() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void connectUnsupportedMethodTest() throws Exception { + // The connect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java new file mode 100644 index 0000000000..0f4e531141 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java @@ -0,0 +1,1614 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +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.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.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.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 MessagingClientTest { + private static MockMessaging mockMessaging; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MessagingClient client; + + @BeforeClass + public static void startStaticServer() { + mockMessaging = new MockMessaging(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockMessaging)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MessagingSettings settings = + MessagingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRoomRequest actualRequest = ((CreateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getRoom().getDisplayName()); + Assert.assertEquals(description, actualRequest.getRoom().getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRoomRequest actualRequest = ((UpdateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getRoom(), actualRequest.getRoom()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRoomsRequest actualRequest = ((ListRoomsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRoomsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBlurbRequest actualRequest = ((UpdateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBlurb(), actualRequest.getBlurb()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 streamBlurbsTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void sendBlurbsTest() throws Exception { + SendBlurbsResponse expectedResponse = + SendBlurbsResponse.newBuilder().addAllNames(new ArrayList()).build(); + mockMessaging.addResponse(expectedResponse); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void sendBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void connectTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void connectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java new file mode 100644 index 0000000000..5c86c23a02 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompliance implements MockGrpcService { + private final MockComplianceImpl serviceImpl; + + public MockCompliance() { + serviceImpl = new MockComplianceImpl(); + } + + @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java new file mode 100644 index 0000000000..5d27cb09c2 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java @@ -0,0 +1,268 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.ComplianceGrpc.ComplianceImplBase; +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 MockComplianceImpl extends ComplianceImplBase { + private List requests; + private Queue responses; + + public MockComplianceImpl() { + 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 repeatDataBody( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBody, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyInfo( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataQuery( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataSimplePath( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataSimplePath, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathResource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathTrailingResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathTrailingResource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPut( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPut, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPatch( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPatch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEnum(EnumRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 GetEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyEnum(EnumResponse request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 VerifyEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java new file mode 100644 index 0000000000..713524d540 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockEcho implements MockGrpcService { + private final MockEchoImpl serviceImpl; + + public MockEcho() { + serviceImpl = new MockEchoImpl(); + } + + @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java new file mode 100644 index 0000000000..ebb4bab00d --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java @@ -0,0 +1,277 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.EchoGrpc.EchoImplBase; +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 MockEchoImpl extends EchoImplBase { + private List requests; + private Queue responses; + + public MockEchoImpl() { + 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 echo(EchoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Echo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void expand(ExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Expand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver collect(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Collect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver chat(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Chat, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void pagedExpand( + PagedExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacy( + PagedExpandLegacyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacyMapped( + PagedExpandRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandLegacyMappedResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandLegacyMappedResponse) 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 PagedExpandLegacyMapped, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandLegacyMappedResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void wait(WaitRequest 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 Wait, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void block(BlockRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BlockResponse) { + requests.add(request); + responseObserver.onNext(((BlockResponse) 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 Block, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BlockResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java new file mode 100644 index 0000000000..c1fa686113 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIdentity implements MockGrpcService { + private final MockIdentityImpl serviceImpl; + + public MockIdentity() { + serviceImpl = new MockIdentityImpl(); + } + + @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java new file mode 100644 index 0000000000..508e333af6 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java @@ -0,0 +1,162 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.IdentityGrpc.IdentityImplBase; +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 MockIdentityImpl extends IdentityImplBase { + private List requests; + private Queue responses; + + public MockIdentityImpl() { + 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 createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) 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 ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java new file mode 100644 index 0000000000..213a8982b8 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMessaging implements MockGrpcService { + private final MockMessagingImpl serviceImpl; + + public MockMessaging() { + serviceImpl = new MockMessagingImpl(); + } + + @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java new file mode 100644 index 0000000000..f14386051c --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java @@ -0,0 +1,380 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.MessagingGrpc.MessagingImplBase; +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 MockMessagingImpl extends MessagingImplBase { + private List requests; + private Queue responses; + + public MockMessagingImpl() { + 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 createRoom(CreateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 CreateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRoom(GetRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 GetRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateRoom(UpdateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 UpdateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRoom(DeleteRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRooms( + ListRoomsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRoomsResponse) { + requests.add(request); + responseObserver.onNext(((ListRoomsResponse) 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 ListRooms, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRoomsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBlurb(CreateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 CreateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBlurb(GetBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 GetBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBlurb(UpdateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 UpdateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBlurb(DeleteBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBlurbs( + ListBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((ListBlurbsResponse) 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 ListBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchBlurbs( + SearchBlurbsRequest 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 SearchBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void streamBlurbs( + StreamBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((StreamBlurbsResponse) 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 StreamBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver sendBlurbs( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(CreateBlurbRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof SendBlurbsResponse) { + responseObserver.onNext(((SendBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SendBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SendBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver connect( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(ConnectRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamBlurbsResponse) { + responseObserver.onNext(((StreamBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Connect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java new file mode 100644 index 0000000000..6e7db409ff --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSequenceService implements MockGrpcService { + private final MockSequenceServiceImpl serviceImpl; + + public MockSequenceService() { + serviceImpl = new MockSequenceServiceImpl(); + } + + @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java new file mode 100644 index 0000000000..a529856c95 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java @@ -0,0 +1,124 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.SequenceServiceGrpc.SequenceServiceImplBase; +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 MockSequenceServiceImpl extends SequenceServiceImplBase { + private List requests; + private Queue responses; + + public MockSequenceServiceImpl() { + 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 createSequence( + CreateSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Sequence) { + requests.add(request); + responseObserver.onNext(((Sequence) 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 CreateSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Sequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSequenceReport( + GetSequenceReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SequenceReport) { + requests.add(request); + responseObserver.onNext(((SequenceReport) 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 GetSequenceReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptSequence( + AttemptSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 AttemptSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java new file mode 100644 index 0000000000..07bf673623 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTesting implements MockGrpcService { + private final MockTestingImpl serviceImpl; + + public MockTesting() { + serviceImpl = new MockTestingImpl(); + } + + @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java new file mode 100644 index 0000000000..8bc492536e --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java @@ -0,0 +1,226 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.TestingGrpc.TestingImplBase; +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 MockTestingImpl extends TestingImplBase { + private List requests; + private Queue responses; + + public MockTestingImpl() { + 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 createSession( + CreateSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 CreateSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSession(GetSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 GetSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSessions( + ListSessionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSessionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSessionsResponse) 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 ListSessions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSessionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSession(DeleteSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reportSession( + ReportSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportSessionResponse) { + requests.add(request); + responseObserver.onNext(((ReportSessionResponse) 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 ReportSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportSessionResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTests( + ListTestsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTestsResponse) { + requests.add(request); + responseObserver.onNext(((ListTestsResponse) 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 ListTests, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTestsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTest(DeleteTestRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyTest( + VerifyTestRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof VerifyTestResponse) { + requests.add(request); + responseObserver.onNext(((VerifyTestResponse) 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 VerifyTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + VerifyTestResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..167002e8f2 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java @@ -0,0 +1,290 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +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 SequenceServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSequenceServiceStub.getMethodDescriptors(), + SequenceServiceSettings.getDefaultEndpoint()); + SequenceServiceSettings settings = + SequenceServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SequenceServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-5566/sequenceReport"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-5566/sequenceReport"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-9950"; + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-9950"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java new file mode 100644 index 0000000000..4b6f722827 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java @@ -0,0 +1,264 @@ +/* + * 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.showcase.v1beta1; + +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.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SequenceServiceClientTest { + private static MockSequenceService mockSequenceService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSequenceService = new MockSequenceService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSequenceService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SequenceServiceSettings settings = + SequenceServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSequenceRequest actualRequest = ((CreateSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(sequence, actualRequest.getSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java new file mode 100644 index 0000000000..b16824b565 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +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 TestingClientHttpJsonTest { + private static MockHttpService mockService; + private static TestingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonTestingStub.getMethodDescriptors(), TestingSettings.getDefaultEndpoint()); + TestingSettings settings = + TestingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + TestingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTestsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockService.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java new file mode 100644 index 0000000000..27ac6b9632 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java @@ -0,0 +1,433 @@ +/* + * 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.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TestingClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockTesting mockTesting; + private LocalChannelProvider channelProvider; + private TestingClient client; + + @BeforeClass + public static void startStaticServer() { + mockTesting = new MockTesting(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTesting)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TestingSettings settings = + TestingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionsRequest actualRequest = ((ListSessionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockTesting.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReportSessionRequest actualRequest = ((ReportSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTestsRequest actualRequest = ((ListTestsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTestsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTestRequest actualRequest = ((DeleteTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockTesting.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + VerifyTestRequest actualRequest = ((VerifyTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAnswer(), actualRequest.getAnswer()); + Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java new file mode 100644 index 0000000000..b73dbd49eb --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java @@ -0,0 +1,75 @@ +/* + * 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.showcase.v1beta1.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.EchoSettings; +import java.io.IOException; +import java.security.GeneralSecurityException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ITFirstHttp { + + private static EchoClient client; + + @BeforeClass + public static void createClient() throws IOException, GeneralSecurityException { + EchoSettings echoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + client = EchoClient.create(echoSettings); + } + + @AfterClass + public static void destroyClient() { + client.close(); + } + + // For 'throws' explanation, see + // https://github.com/googleapis/gapic-showcase/blob/v0.25.0/util/genrest/resttools/systemparam.go#L37-L46 + @Test + public void testEcho() { + assertThrows( + InvalidArgumentException.class, () -> assertEquals("http-echo?", echo("http-echo?"))); + + assertThrows( + InvalidArgumentException.class, () -> assertEquals("http-echo!", echo("http-echo!"))); + } + + private String echo(String value) { + EchoResponse response = client.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java new file mode 100644 index 0000000000..32d941c722 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java @@ -0,0 +1,75 @@ +/* + * 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.showcase.v1beta1.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.EchoSettings; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ITFirstRpc { + + private static EchoClient client; + + @Before + public void createClient() throws IOException { + EchoSettings echoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + InstantiatingGrpcChannelProvider.newBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + + client = EchoClient.create(echoSettings); + } + + @After + public void destroyClient() { + client.close(); + } + + @Test + public void testEcho() { + assertEquals("grpc-echo?", echo("grpc-echo?")); + assertEquals("grpc-echo!", echo("grpc-echo!")); + } + + @Test + public void testShutdown() { + assertFalse(client.isShutdown()); + client.shutdown(); + assertTrue(client.isShutdown()); + } + + private String echo(String value) { + EchoResponse response = client.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java new file mode 100644 index 0000000000..5818010484 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java @@ -0,0 +1,71 @@ +/* + * 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.showcase.v1beta1.it; + +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EnumRequest; +import java.io.IOException; +import java.security.GeneralSecurityException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ITNumericEnums { + + private ComplianceClient client; + + @Before + public void createClient() throws GeneralSecurityException, IOException { + ComplianceSettings complianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + client = ComplianceClient.create(complianceSettings); + } + + @After + public void destroyClient() { + client.close(); + } + + // See + // https://github.com/googleapis/gapic-showcase/blob/v0.25.0/util/genrest/resttools/systemparam.go#L37-L46 + @Test + public void verifyEnums() { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + // EnumResponse initialResponse = + assertThrows(InvalidArgumentException.class, () -> client.getEnum(request)); + + // EnumResponse verifiedResponse = client.verifyEnum(initialResponse); + // + // Assert.assertNotNull(initialResponse); + // Assert.assertEquals(initialResponse, verifiedResponse); + } +} diff --git a/showcase/google-cloud-jar-parent/pom.xml b/showcase/google-cloud-jar-parent/pom.xml new file mode 100644 index 0000000000..dea102ae94 --- /dev/null +++ b/showcase/google-cloud-jar-parent/pom.xml @@ -0,0 +1,285 @@ + + + 4.0.0 + google-cloud-jar-parent + com.google.cloud + 0.0.0-SNAPSHOT + pom + Google Cloud JAR Parent + + The parent for all client library JAR modules in the repository. + + + + com.google.cloud + google-cloud-pom-parent + 0.0.0-SNAPSHOT + ../google-cloud-pom-parent/pom.xml + + + true + true + true + true + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.0.6 + pom + import + + + io.perfmark + perfmark-api + 0.26.0 + + + com.google.cloud + google-cloud-pubsub-bom + 1.121.1 + pom + import + + + com.google.cloud + google-cloud-storage + 2.15.1 + + + com.google.apis + google-api-services-dns + v1-rev20221110-2.0.0 + + + com.google.apis + google-api-services-translate + v2-rev20170525-2.0.0 + + + com.google.apis + google-api-services-cloudresourcemanager + v1-rev20220807-2.0.0 + + + com.google.apis + google-api-services-storage + v1-rev20220705-2.0.0 + + + + + junit + junit + 4.13.2 + test + + + joda-time + joda-time + 2.12.1 + test + + + com.google.truth + truth + 1.1.3 + test + + + org.checkerframework + checker-qual + + + + + org.easymock + easymock + 5.0.1 + test + + + com.google.api.grpc + grpc-google-common-protos + 2.10.0 + test + + + org.mockito + mockito-all + 1.10.19 + test + + + org.objenesis + objenesis + 3.3 + test + + + + + + + java9 + + [9,) + + + + + javax.annotation + javax.annotation-api + provided + + + + + java17 + + [17,) + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens=java.base/java.time=ALL-UNNAMED + --add-opens=java.base/java.math=ALL-UNNAMED + --add-opens=java.base/sun.security.rsa=ALL-UNNAMED + --add-opens=java.base/sun.security.pkcs=ALL-UNNAMED + --add-opens=java.base/sun.security.x509=ALL-UNNAMED + --add-opens=java.base/sun.security.util=ALL-UNNAMED + --add-opens=java.base/java.security=ALL-UNNAMED + --add-opens=java.base/java.lang=ALL-UNNAMED + + + + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + + + prepare-agent + + + + report + test + + report + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + 1C + true + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.4.1 + + + + 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.1 + + + 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/ + + + + + + + \ No newline at end of file diff --git a/showcase/google-cloud-pom-parent/java.header b/showcase/google-cloud-pom-parent/java.header new file mode 100644 index 0000000000..772004189a --- /dev/null +++ b/showcase/google-cloud-pom-parent/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\.$ +^ \*/$ \ No newline at end of file diff --git a/showcase/google-cloud-pom-parent/license-checks.xml b/showcase/google-cloud-pom-parent/license-checks.xml new file mode 100644 index 0000000000..574f1d42fd --- /dev/null +++ b/showcase/google-cloud-pom-parent/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/showcase/google-cloud-pom-parent/pom.xml b/showcase/google-cloud-pom-parent/pom.xml new file mode 100644 index 0000000000..8a48863524 --- /dev/null +++ b/showcase/google-cloud-pom-parent/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + google-cloud-pom-parent + com.google.cloud + 0.0.0-SNAPSHOT + pom + Google Cloud POM Parent + + com.google.cloud + google-cloud-shared-config + 1.5.4 + + + + java.header + + + Google LLC + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + \ No newline at end of file diff --git a/showcase/grpc-gapic-showcase-v1beta1/pom.xml b/showcase/grpc-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..8f793f6aeb --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.0-SNAPSHOT + grpc-gapic-showcase-v1beta1 + GRPC library for grpc-google-cloud-iot-v1 + + com.google.cloud + gapic-showcase-parent + 0.0.0-SNAPSHOT + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + generate-showcase + + exec + + generate-sources + + bazel + + run + //showcase:update_grpc + + + + + + + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java new file mode 100644 index 0000000000..31504f489d --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -0,0 +1,942 @@ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: schema/google/showcase/v1beta1/compliance.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ComplianceGrpc { + + private ComplianceGrpc() {} + + public static final String SERVICE_NAME = "google.showcase.v1beta1.Compliance"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getRepeatDataBodyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBody", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataBodyMethod() { + io.grpc.MethodDescriptor getRepeatDataBodyMethod; + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + ComplianceGrpc.getRepeatDataBodyMethod = getRepeatDataBodyMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBody")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBody")) + .build(); + } + } + } + return getRepeatDataBodyMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataBodyInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyInfo", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataBodyInfoMethod() { + io.grpc.MethodDescriptor getRepeatDataBodyInfoMethod; + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + ComplianceGrpc.getRepeatDataBodyInfoMethod = getRepeatDataBodyInfoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBodyInfo")) + .build(); + } + } + } + return getRepeatDataBodyInfoMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataQuery", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataQueryMethod() { + io.grpc.MethodDescriptor getRepeatDataQueryMethod; + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + ComplianceGrpc.getRepeatDataQueryMethod = getRepeatDataQueryMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataQuery")) + .build(); + } + } + } + return getRepeatDataQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataSimplePathMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataSimplePath", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataSimplePathMethod() { + io.grpc.MethodDescriptor getRepeatDataSimplePathMethod; + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { + ComplianceGrpc.getRepeatDataSimplePathMethod = getRepeatDataSimplePathMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataSimplePath")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataSimplePath")) + .build(); + } + } + } + return getRepeatDataSimplePathMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataPathResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataPathResourceMethod() { + io.grpc.MethodDescriptor getRepeatDataPathResourceMethod; + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) == null) { + ComplianceGrpc.getRepeatDataPathResourceMethod = getRepeatDataPathResourceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataPathResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataPathResource")) + .build(); + } + } + } + return getRepeatDataPathResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataPathTrailingResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathTrailingResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataPathTrailingResourceMethod() { + io.grpc.MethodDescriptor getRepeatDataPathTrailingResourceMethod; + if ((getRepeatDataPathTrailingResourceMethod = ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathTrailingResourceMethod = ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) == null) { + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod = getRepeatDataPathTrailingResourceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataPathTrailingResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataPathTrailingResource")) + .build(); + } + } + } + return getRepeatDataPathTrailingResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataBodyPutMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPut", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataBodyPutMethod() { + io.grpc.MethodDescriptor getRepeatDataBodyPutMethod; + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPutMethod = getRepeatDataBodyPutMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPut")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBodyPut")) + .build(); + } + } + } + return getRepeatDataBodyPutMethod; + } + + private static volatile io.grpc.MethodDescriptor getRepeatDataBodyPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPatch", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRepeatDataBodyPatchMethod() { + io.grpc.MethodDescriptor getRepeatDataBodyPatchMethod; + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPatchMethod = getRepeatDataBodyPatchMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPatch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBodyPatch")) + .build(); + } + } + } + return getRepeatDataBodyPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEnum", + requestType = com.google.showcase.v1beta1.EnumRequest.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetEnumMethod() { + io.grpc.MethodDescriptor getGetEnumMethod; + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + ComplianceGrpc.getGetEnumMethod = getGetEnumMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("GetEnum")) + .build(); + } + } + } + return getGetEnumMethod; + } + + private static volatile io.grpc.MethodDescriptor getVerifyEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyEnum", + requestType = com.google.showcase.v1beta1.EnumResponse.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getVerifyEnumMethod() { + io.grpc.MethodDescriptor getVerifyEnumMethod; + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + ComplianceGrpc.getVerifyEnumMethod = getVerifyEnumMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("VerifyEnum")) + .build(); + } + } + } + return getVerifyEnumMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ComplianceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + }; + return ComplianceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ComplianceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + }; + return ComplianceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ComplianceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + }; + return ComplianceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class ComplianceImplBase implements io.grpc.BindableService { + + /** + */ + public void repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyMethod(), responseObserver); + } + + /** + */ + public void repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyInfoMethod(), responseObserver); + } + + /** + */ + public void repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataQueryMethod(), responseObserver); + } + + /** + */ + public void repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataSimplePathMethod(), responseObserver); + } + + /** + */ + public void repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataPathResourceMethod(), responseObserver); + } + + /** + */ + public void repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataPathTrailingResourceMethod(), responseObserver); + } + + /** + */ + public void repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyPutMethod(), responseObserver); + } + + /** + */ + public void repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyPatchMethod(), responseObserver); + } + + /** + */ + public void getEnum(com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); + } + + /** + */ + public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRepeatDataBodyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_BODY))) + .addMethod( + getRepeatDataBodyInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_BODY_INFO))) + .addMethod( + getRepeatDataQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_QUERY))) + .addMethod( + getRepeatDataSimplePathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_SIMPLE_PATH))) + .addMethod( + getRepeatDataPathResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_PATH_RESOURCE))) + .addMethod( + getRepeatDataPathTrailingResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) + .addMethod( + getRepeatDataBodyPutMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_BODY_PUT))) + .addMethod( + getRepeatDataBodyPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + this, METHODID_REPEAT_DATA_BODY_PATCH))) + .addMethod( + getGetEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumResponse>( + this, METHODID_GET_ENUM))) + .addMethod( + getVerifyEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumResponse, + com.google.showcase.v1beta1.EnumResponse>( + this, METHODID_VERIFY_ENUM))) + .build(); + } + } + + /** + */ + public static final class ComplianceStub extends io.grpc.stub.AbstractAsyncStub { + private ComplianceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + + /** + */ + public void repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getEnum(com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class ComplianceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.EnumResponse getEnum(com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum(com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class ComplianceFutureStub extends io.grpc.stub.AbstractFutureStub { + private ComplianceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getEnum( + com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_REPEAT_DATA_BODY = 0; + private static final int METHODID_REPEAT_DATA_BODY_INFO = 1; + private static final int METHODID_REPEAT_DATA_QUERY = 2; + private static final int METHODID_REPEAT_DATA_SIMPLE_PATH = 3; + private static final int METHODID_REPEAT_DATA_PATH_RESOURCE = 4; + private static final int METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE = 5; + private static final int METHODID_REPEAT_DATA_BODY_PUT = 6; + private static final int METHODID_REPEAT_DATA_BODY_PATCH = 7; + private static final int METHODID_GET_ENUM = 8; + private static final int METHODID_VERIFY_ENUM = 9; + + 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 ComplianceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ComplianceImplBase 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_REPEAT_DATA_BODY: + serviceImpl.repeatDataBody((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_INFO: + serviceImpl.repeatDataBodyInfo((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_QUERY: + serviceImpl.repeatDataQuery((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_SIMPLE_PATH: + serviceImpl.repeatDataSimplePath((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_RESOURCE: + serviceImpl.repeatDataPathResource((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE: + serviceImpl.repeatDataPathTrailingResource((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PUT: + serviceImpl.repeatDataBodyPut((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PATCH: + serviceImpl.repeatDataBodyPatch((com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ENUM: + serviceImpl.getEnum((com.google.showcase.v1beta1.EnumRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VERIFY_ENUM: + serviceImpl.verifyEnum((com.google.showcase.v1beta1.EnumResponse) 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 static abstract class ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ComplianceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Compliance"); + } + } + + private static final class ComplianceFileDescriptorSupplier + extends ComplianceBaseDescriptorSupplier { + ComplianceFileDescriptorSupplier() {} + } + + private static final class ComplianceMethodDescriptorSupplier + extends ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ComplianceMethodDescriptorSupplier(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 (ComplianceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ComplianceFileDescriptorSupplier()) + .addMethod(getRepeatDataBodyMethod()) + .addMethod(getRepeatDataBodyInfoMethod()) + .addMethod(getRepeatDataQueryMethod()) + .addMethod(getRepeatDataSimplePathMethod()) + .addMethod(getRepeatDataPathResourceMethod()) + .addMethod(getRepeatDataPathTrailingResourceMethod()) + .addMethod(getRepeatDataBodyPutMethod()) + .addMethod(getRepeatDataBodyPatchMethod()) + .addMethod(getGetEnumMethod()) + .addMethod(getVerifyEnumMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java new file mode 100644 index 0000000000..fb0405e1ec --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -0,0 +1,829 @@ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: schema/google/showcase/v1beta1/echo.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class EchoGrpc { + + private EchoGrpc() {} + + public static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getEchoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Echo", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEchoMethod() { + io.grpc.MethodDescriptor getEchoMethod; + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + EchoGrpc.getEchoMethod = getEchoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Echo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Echo")) + .build(); + } + } + } + return getEchoMethod; + } + + private static volatile io.grpc.MethodDescriptor getExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Expand", + requestType = com.google.showcase.v1beta1.ExpandRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getExpandMethod() { + io.grpc.MethodDescriptor getExpandMethod; + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + EchoGrpc.getExpandMethod = getExpandMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Expand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Expand")) + .build(); + } + } + } + return getExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor getCollectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Collect", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor getCollectMethod() { + io.grpc.MethodDescriptor getCollectMethod; + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + EchoGrpc.getCollectMethod = getCollectMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Collect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Collect")) + .build(); + } + } + } + return getCollectMethod; + } + + private static volatile io.grpc.MethodDescriptor getChatMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Chat", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getChatMethod() { + io.grpc.MethodDescriptor getChatMethod; + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + EchoGrpc.getChatMethod = getChatMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Chat")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Chat")) + .build(); + } + } + } + return getChatMethod; + } + + private static volatile io.grpc.MethodDescriptor getPagedExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpand", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPagedExpandMethod() { + io.grpc.MethodDescriptor getPagedExpandMethod; + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + EchoGrpc.getPagedExpandMethod = getPagedExpandMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpand")) + .build(); + } + } + } + return getPagedExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor getPagedExpandLegacyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacy", + requestType = com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPagedExpandLegacyMethod() { + io.grpc.MethodDescriptor getPagedExpandLegacyMethod; + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + EchoGrpc.getPagedExpandLegacyMethod = getPagedExpandLegacyMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacy")) + .build(); + } + } + } + return getPagedExpandLegacyMethod; + } + + private static volatile io.grpc.MethodDescriptor getPagedExpandLegacyMappedMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacyMapped", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPagedExpandLegacyMappedMethod() { + io.grpc.MethodDescriptor getPagedExpandLegacyMappedMethod; + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { + EchoGrpc.getPagedExpandLegacyMappedMethod = getPagedExpandLegacyMappedMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacyMapped")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacyMapped")) + .build(); + } + } + } + return getPagedExpandLegacyMappedMethod; + } + + private static volatile io.grpc.MethodDescriptor getWaitMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Wait", + requestType = com.google.showcase.v1beta1.WaitRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getWaitMethod() { + io.grpc.MethodDescriptor getWaitMethod; + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + EchoGrpc.getWaitMethod = getWaitMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Wait")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.WaitRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Wait")) + .build(); + } + } + } + return getWaitMethod; + } + + private static volatile io.grpc.MethodDescriptor getBlockMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Block", + requestType = com.google.showcase.v1beta1.BlockRequest.class, + responseType = com.google.showcase.v1beta1.BlockResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getBlockMethod() { + io.grpc.MethodDescriptor getBlockMethod; + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + EchoGrpc.getBlockMethod = getBlockMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Block")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Block")) + .build(); + } + } + } + return getBlockMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static EchoStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + }; + return EchoStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EchoBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + }; + return EchoBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static EchoFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + }; + return EchoFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class EchoImplBase implements io.grpc.BindableService { + + /** + */ + public void echo(com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); + } + + /** + */ + public void expand(com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getCollectMethod(), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getChatMethod(), responseObserver); + } + + /** + */ + public void pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandMethod(), responseObserver); + } + + /** + */ + public void pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandLegacyMethod(), responseObserver); + } + + /** + */ + public void pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandLegacyMappedMethod(), responseObserver); + } + + /** + */ + public void wait(com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); + } + + /** + */ + public void block(com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getEchoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>( + this, METHODID_ECHO))) + .addMethod( + getExpandMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ExpandRequest, + com.google.showcase.v1beta1.EchoResponse>( + this, METHODID_EXPAND))) + .addMethod( + getCollectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>( + this, METHODID_COLLECT))) + .addMethod( + getChatMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>( + this, METHODID_CHAT))) + .addMethod( + getPagedExpandMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + this, METHODID_PAGED_EXPAND))) + .addMethod( + getPagedExpandLegacyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + this, METHODID_PAGED_EXPAND_LEGACY))) + .addMethod( + getPagedExpandLegacyMappedMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( + this, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) + .addMethod( + getWaitMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.WaitRequest, + com.google.longrunning.Operation>( + this, METHODID_WAIT))) + .addMethod( + getBlockMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.BlockRequest, + com.google.showcase.v1beta1.BlockResponse>( + this, METHODID_BLOCK))) + .build(); + } + } + + /** + */ + public static final class EchoStub extends io.grpc.stub.AbstractAsyncStub { + private EchoStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + + /** + */ + public void echo(com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void expand(com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getExpandMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getCollectMethod(), getCallOptions()), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getChatMethod(), getCallOptions()), responseObserver); + } + + /** + */ + public void pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void wait(com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void block(com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class EchoBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + + /** + */ + public com.google.showcase.v1beta1.EchoResponse echo(com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.BlockResponse block(com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class EchoFutureStub extends io.grpc.stub.AbstractFutureStub { + private EchoFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture echo( + com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture wait( + com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture block( + com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ECHO = 0; + private static final int METHODID_EXPAND = 1; + private static final int METHODID_PAGED_EXPAND = 2; + private static final int METHODID_PAGED_EXPAND_LEGACY = 3; + private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 4; + private static final int METHODID_WAIT = 5; + private static final int METHODID_BLOCK = 6; + private static final int METHODID_COLLECT = 7; + private static final int METHODID_CHAT = 8; + + 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 EchoImplBase serviceImpl; + private final int methodId; + + MethodHandlers(EchoImplBase 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_ECHO: + serviceImpl.echo((com.google.showcase.v1beta1.EchoRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXPAND: + serviceImpl.expand((com.google.showcase.v1beta1.ExpandRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PAGED_EXPAND: + serviceImpl.pagedExpand((com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY: + serviceImpl.pagedExpandLegacy((com.google.showcase.v1beta1.PagedExpandLegacyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY_MAPPED: + serviceImpl.pagedExpandLegacyMapped((com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_WAIT: + serviceImpl.wait((com.google.showcase.v1beta1.WaitRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BLOCK: + serviceImpl.block((com.google.showcase.v1beta1.BlockRequest) 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) { + case METHODID_COLLECT: + return (io.grpc.stub.StreamObserver) serviceImpl.collect( + (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_CHAT: + return (io.grpc.stub.StreamObserver) serviceImpl.chat( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EchoBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Echo"); + } + } + + private static final class EchoFileDescriptorSupplier + extends EchoBaseDescriptorSupplier { + EchoFileDescriptorSupplier() {} + } + + private static final class EchoMethodDescriptorSupplier + extends EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + EchoMethodDescriptorSupplier(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 (EchoGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EchoFileDescriptorSupplier()) + .addMethod(getEchoMethod()) + .addMethod(getExpandMethod()) + .addMethod(getCollectMethod()) + .addMethod(getChatMethod()) + .addMethod(getPagedExpandMethod()) + .addMethod(getPagedExpandLegacyMethod()) + .addMethod(getPagedExpandLegacyMappedMethod()) + .addMethod(getWaitMethod()) + .addMethod(getBlockMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java new file mode 100644 index 0000000000..bcfa37a663 --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -0,0 +1,572 @@ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: schema/google/showcase/v1beta1/identity.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class IdentityGrpc { + + private IdentityGrpc() {} + + public static final String SERVICE_NAME = "google.showcase.v1beta1.Identity"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.showcase.v1beta1.CreateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateUserMethod() { + io.grpc.MethodDescriptor getCreateUserMethod; + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + IdentityGrpc.getCreateUserMethod = getCreateUserMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.showcase.v1beta1.GetUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetUserMethod() { + io.grpc.MethodDescriptor getGetUserMethod; + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + IdentityGrpc.getGetUserMethod = getGetUserMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.showcase.v1beta1.UpdateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateUserMethod() { + io.grpc.MethodDescriptor getUpdateUserMethod; + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + IdentityGrpc.getUpdateUserMethod = getUpdateUserMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.showcase.v1beta1.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteUserMethod() { + io.grpc.MethodDescriptor getDeleteUserMethod; + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + IdentityGrpc.getDeleteUserMethod = getDeleteUserMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + + private static volatile io.grpc.MethodDescriptor getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.showcase.v1beta1.ListUsersRequest.class, + responseType = com.google.showcase.v1beta1.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListUsersMethod() { + io.grpc.MethodDescriptor getListUsersMethod; + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + IdentityGrpc.getListUsersMethod = getListUsersMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static IdentityStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + }; + return IdentityStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static IdentityBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + }; + return IdentityBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static IdentityFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + }; + return IdentityFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class IdentityImplBase implements io.grpc.BindableService { + + /** + */ + public void createUser(com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + */ + public void getUser(com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + */ + public void updateUser(com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + */ + public void deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } + + /** + */ + public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateUserRequest, + com.google.showcase.v1beta1.User>( + this, METHODID_CREATE_USER))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetUserRequest, + com.google.showcase.v1beta1.User>( + this, METHODID_GET_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateUserRequest, + com.google.showcase.v1beta1.User>( + this, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteUserRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_USER))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse>( + this, METHODID_LIST_USERS))) + .build(); + } + } + + /** + */ + public static final class IdentityStub extends io.grpc.stub.AbstractAsyncStub { + private IdentityStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + + /** + */ + public void createUser(com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getUser(com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void updateUser(com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class IdentityBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + + /** + */ + public com.google.showcase.v1beta1.User createUser(com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.User getUser(com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.User updateUser(com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.protobuf.Empty deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers(com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class IdentityFutureStub extends io.grpc.stub.AbstractFutureStub { + private IdentityFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createUser( + com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getUser( + com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_USER = 0; + private static final int METHODID_GET_USER = 1; + private static final int METHODID_UPDATE_USER = 2; + private static final int METHODID_DELETE_USER = 3; + private static final int METHODID_LIST_USERS = 4; + + 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 IdentityImplBase serviceImpl; + private final int methodId; + + MethodHandlers(IdentityImplBase 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_CREATE_USER: + serviceImpl.createUser((com.google.showcase.v1beta1.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser((com.google.showcase.v1beta1.GetUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser((com.google.showcase.v1beta1.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser((com.google.showcase.v1beta1.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_USERS: + serviceImpl.listUsers((com.google.showcase.v1beta1.ListUsersRequest) 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 static abstract class IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + IdentityBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Identity"); + } + } + + private static final class IdentityFileDescriptorSupplier + extends IdentityBaseDescriptorSupplier { + IdentityFileDescriptorSupplier() {} + } + + private static final class IdentityMethodDescriptorSupplier + extends IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + IdentityMethodDescriptorSupplier(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 (IdentityGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new IdentityFileDescriptorSupplier()) + .addMethod(getCreateUserMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) + .addMethod(getListUsersMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java new file mode 100644 index 0000000000..906dfe779e --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -0,0 +1,1199 @@ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: schema/google/showcase/v1beta1/messaging.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MessagingGrpc { + + private MessagingGrpc() {} + + public static final String SERVICE_NAME = "google.showcase.v1beta1.Messaging"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRoom", + requestType = com.google.showcase.v1beta1.CreateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateRoomMethod() { + io.grpc.MethodDescriptor getCreateRoomMethod; + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + MessagingGrpc.getCreateRoomMethod = getCreateRoomMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateRoom")) + .build(); + } + } + } + return getCreateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRoom", + requestType = com.google.showcase.v1beta1.GetRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetRoomMethod() { + io.grpc.MethodDescriptor getGetRoomMethod; + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + MessagingGrpc.getGetRoomMethod = getGetRoomMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetRoom")) + .build(); + } + } + } + return getGetRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateRoom", + requestType = com.google.showcase.v1beta1.UpdateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateRoomMethod() { + io.grpc.MethodDescriptor getUpdateRoomMethod; + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + MessagingGrpc.getUpdateRoomMethod = getUpdateRoomMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateRoom")) + .build(); + } + } + } + return getUpdateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRoom", + requestType = com.google.showcase.v1beta1.DeleteRoomRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteRoomMethod() { + io.grpc.MethodDescriptor getDeleteRoomMethod; + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + MessagingGrpc.getDeleteRoomMethod = getDeleteRoomMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteRoom")) + .build(); + } + } + } + return getDeleteRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor getListRoomsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRooms", + requestType = com.google.showcase.v1beta1.ListRoomsRequest.class, + responseType = com.google.showcase.v1beta1.ListRoomsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListRoomsMethod() { + io.grpc.MethodDescriptor getListRoomsMethod; + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + MessagingGrpc.getListRoomsMethod = getListRoomsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRooms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListRooms")) + .build(); + } + } + } + return getListRoomsMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBlurb", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateBlurbMethod() { + io.grpc.MethodDescriptor getCreateBlurbMethod; + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + MessagingGrpc.getCreateBlurbMethod = getCreateBlurbMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateBlurb")) + .build(); + } + } + } + return getCreateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBlurb", + requestType = com.google.showcase.v1beta1.GetBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetBlurbMethod() { + io.grpc.MethodDescriptor getGetBlurbMethod; + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + MessagingGrpc.getGetBlurbMethod = getGetBlurbMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetBlurb")) + .build(); + } + } + } + return getGetBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBlurb", + requestType = com.google.showcase.v1beta1.UpdateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateBlurbMethod() { + io.grpc.MethodDescriptor getUpdateBlurbMethod; + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + MessagingGrpc.getUpdateBlurbMethod = getUpdateBlurbMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateBlurb")) + .build(); + } + } + } + return getUpdateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBlurb", + requestType = com.google.showcase.v1beta1.DeleteBlurbRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteBlurbMethod() { + io.grpc.MethodDescriptor getDeleteBlurbMethod; + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + MessagingGrpc.getDeleteBlurbMethod = getDeleteBlurbMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteBlurb")) + .build(); + } + } + } + return getDeleteBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor getListBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBlurbs", + requestType = com.google.showcase.v1beta1.ListBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.ListBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListBlurbsMethod() { + io.grpc.MethodDescriptor getListBlurbsMethod; + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + MessagingGrpc.getListBlurbsMethod = getListBlurbsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListBlurbs")) + .build(); + } + } + } + return getListBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor getSearchBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchBlurbs", + requestType = com.google.showcase.v1beta1.SearchBlurbsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSearchBlurbsMethod() { + io.grpc.MethodDescriptor getSearchBlurbsMethod; + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + MessagingGrpc.getSearchBlurbsMethod = getSearchBlurbsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SearchBlurbs")) + .build(); + } + } + } + return getSearchBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor getStreamBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamBlurbs", + requestType = com.google.showcase.v1beta1.StreamBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getStreamBlurbsMethod() { + io.grpc.MethodDescriptor getStreamBlurbsMethod; + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + MessagingGrpc.getStreamBlurbsMethod = getStreamBlurbsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("StreamBlurbs")) + .build(); + } + } + } + return getStreamBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor getSendBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendBlurbs", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.SendBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor getSendBlurbsMethod() { + io.grpc.MethodDescriptor getSendBlurbsMethod; + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + MessagingGrpc.getSendBlurbsMethod = getSendBlurbsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SendBlurbs")) + .build(); + } + } + } + return getSendBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor getConnectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Connect", + requestType = com.google.showcase.v1beta1.ConnectRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getConnectMethod() { + io.grpc.MethodDescriptor getConnectMethod; + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + MessagingGrpc.getConnectMethod = getConnectMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Connect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("Connect")) + .build(); + } + } + } + return getConnectMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MessagingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + }; + return MessagingStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MessagingBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + }; + return MessagingBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MessagingFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + }; + return MessagingFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class MessagingImplBase implements io.grpc.BindableService { + + /** + */ + public void createRoom(com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); + } + + /** + */ + public void getRoom(com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); + } + + /** + */ + public void updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); + } + + /** + */ + public void deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); + } + + /** + */ + public void listRooms(com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); + } + + /** + */ + public void createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateBlurbMethod(), responseObserver); + } + + /** + */ + public void getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); + } + + /** + */ + public void updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateBlurbMethod(), responseObserver); + } + + /** + */ + public void deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteBlurbMethod(), responseObserver); + } + + /** + */ + public void listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); + } + + /** + */ + public void searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchBlurbsMethod(), responseObserver); + } + + /** + */ + public void streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamBlurbsMethod(), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendBlurbsMethod(), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getConnectMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateRoomRequest, + com.google.showcase.v1beta1.Room>( + this, METHODID_CREATE_ROOM))) + .addMethod( + getGetRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetRoomRequest, + com.google.showcase.v1beta1.Room>( + this, METHODID_GET_ROOM))) + .addMethod( + getUpdateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateRoomRequest, + com.google.showcase.v1beta1.Room>( + this, METHODID_UPDATE_ROOM))) + .addMethod( + getDeleteRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteRoomRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_ROOM))) + .addMethod( + getListRoomsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse>( + this, METHODID_LIST_ROOMS))) + .addMethod( + getCreateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.Blurb>( + this, METHODID_CREATE_BLURB))) + .addMethod( + getGetBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetBlurbRequest, + com.google.showcase.v1beta1.Blurb>( + this, METHODID_GET_BLURB))) + .addMethod( + getUpdateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateBlurbRequest, + com.google.showcase.v1beta1.Blurb>( + this, METHODID_UPDATE_BLURB))) + .addMethod( + getDeleteBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteBlurbRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_BLURB))) + .addMethod( + getListBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse>( + this, METHODID_LIST_BLURBS))) + .addMethod( + getSearchBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.SearchBlurbsRequest, + com.google.longrunning.Operation>( + this, METHODID_SEARCH_BLURBS))) + .addMethod( + getStreamBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + this, METHODID_STREAM_BLURBS))) + .addMethod( + getSendBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse>( + this, METHODID_SEND_BLURBS))) + .addMethod( + getConnectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + this, METHODID_CONNECT))) + .build(); + } + } + + /** + */ + public static final class MessagingStub extends io.grpc.stub.AbstractAsyncStub { + private MessagingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + + /** + */ + public void createRoom(com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getRoom(com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listRooms(com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getStreamBlurbsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getSendBlurbsMethod(), getCallOptions()), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); + } + } + + /** + */ + public static final class MessagingBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + + /** + */ + public com.google.showcase.v1beta1.Room createRoom(com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.Room getRoom(com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.Room updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.protobuf.Empty deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.Blurb createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.Blurb getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.Blurb updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.protobuf.Empty deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.longrunning.Operation searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class MessagingFutureStub extends io.grpc.stub.AbstractFutureStub { + private MessagingFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_ROOM = 0; + private static final int METHODID_GET_ROOM = 1; + private static final int METHODID_UPDATE_ROOM = 2; + private static final int METHODID_DELETE_ROOM = 3; + private static final int METHODID_LIST_ROOMS = 4; + private static final int METHODID_CREATE_BLURB = 5; + private static final int METHODID_GET_BLURB = 6; + private static final int METHODID_UPDATE_BLURB = 7; + private static final int METHODID_DELETE_BLURB = 8; + private static final int METHODID_LIST_BLURBS = 9; + private static final int METHODID_SEARCH_BLURBS = 10; + private static final int METHODID_STREAM_BLURBS = 11; + private static final int METHODID_SEND_BLURBS = 12; + private static final int METHODID_CONNECT = 13; + + 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 MessagingImplBase serviceImpl; + private final int methodId; + + MethodHandlers(MessagingImplBase 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_CREATE_ROOM: + serviceImpl.createRoom((com.google.showcase.v1beta1.CreateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ROOM: + serviceImpl.getRoom((com.google.showcase.v1beta1.GetRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ROOM: + serviceImpl.updateRoom((com.google.showcase.v1beta1.UpdateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ROOM: + serviceImpl.deleteRoom((com.google.showcase.v1beta1.DeleteRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ROOMS: + serviceImpl.listRooms((com.google.showcase.v1beta1.ListRoomsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BLURB: + serviceImpl.createBlurb((com.google.showcase.v1beta1.CreateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BLURB: + serviceImpl.getBlurb((com.google.showcase.v1beta1.GetBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BLURB: + serviceImpl.updateBlurb((com.google.showcase.v1beta1.UpdateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BLURB: + serviceImpl.deleteBlurb((com.google.showcase.v1beta1.DeleteBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BLURBS: + serviceImpl.listBlurbs((com.google.showcase.v1beta1.ListBlurbsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SEARCH_BLURBS: + serviceImpl.searchBlurbs((com.google.showcase.v1beta1.SearchBlurbsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STREAM_BLURBS: + serviceImpl.streamBlurbs((com.google.showcase.v1beta1.StreamBlurbsRequest) 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) { + case METHODID_SEND_BLURBS: + return (io.grpc.stub.StreamObserver) serviceImpl.sendBlurbs( + (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_CONNECT: + return (io.grpc.stub.StreamObserver) serviceImpl.connect( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MessagingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Messaging"); + } + } + + private static final class MessagingFileDescriptorSupplier + extends MessagingBaseDescriptorSupplier { + MessagingFileDescriptorSupplier() {} + } + + private static final class MessagingMethodDescriptorSupplier + extends MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MessagingMethodDescriptorSupplier(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 (MessagingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MessagingFileDescriptorSupplier()) + .addMethod(getCreateRoomMethod()) + .addMethod(getGetRoomMethod()) + .addMethod(getUpdateRoomMethod()) + .addMethod(getDeleteRoomMethod()) + .addMethod(getListRoomsMethod()) + .addMethod(getCreateBlurbMethod()) + .addMethod(getGetBlurbMethod()) + .addMethod(getUpdateBlurbMethod()) + .addMethod(getDeleteBlurbMethod()) + .addMethod(getListBlurbsMethod()) + .addMethod(getSearchBlurbsMethod()) + .addMethod(getStreamBlurbsMethod()) + .addMethod(getSendBlurbsMethod()) + .addMethod(getConnectMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java new file mode 100644 index 0000000000..5c96630fef --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -0,0 +1,424 @@ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: schema/google/showcase/v1beta1/sequence.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SequenceServiceGrpc { + + private SequenceServiceGrpc() {} + + public static final String SERVICE_NAME = "google.showcase.v1beta1.SequenceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSequence", + requestType = com.google.showcase.v1beta1.CreateSequenceRequest.class, + responseType = com.google.showcase.v1beta1.Sequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateSequenceMethod() { + io.grpc.MethodDescriptor getCreateSequenceMethod; + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + SequenceServiceGrpc.getCreateSequenceMethod = getCreateSequenceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Sequence.getDefaultInstance())) + .setSchemaDescriptor(new SequenceServiceMethodDescriptorSupplier("CreateSequence")) + .build(); + } + } + } + return getCreateSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSequenceReport", + requestType = com.google.showcase.v1beta1.GetSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.SequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSequenceReportMethod() { + io.grpc.MethodDescriptor getGetSequenceReportMethod; + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + SequenceServiceGrpc.getGetSequenceReportMethod = getGetSequenceReportMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SequenceReport.getDefaultInstance())) + .setSchemaDescriptor(new SequenceServiceMethodDescriptorSupplier("GetSequenceReport")) + .build(); + } + } + } + return getGetSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor getAttemptSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptSequence", + requestType = com.google.showcase.v1beta1.AttemptSequenceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getAttemptSequenceMethod() { + io.grpc.MethodDescriptor getAttemptSequenceMethod; + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + SequenceServiceGrpc.getAttemptSequenceMethod = getAttemptSequenceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AttemptSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new SequenceServiceMethodDescriptorSupplier("AttemptSequence")) + .build(); + } + } + } + return getAttemptSequenceMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static SequenceServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + }; + return SequenceServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SequenceServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + }; + return SequenceServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static SequenceServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + }; + return SequenceServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class SequenceServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSequenceMethod(), responseObserver); + } + + /** + */ + public void getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSequenceReportMethod(), responseObserver); + } + + /** + */ + public void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAttemptSequenceMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSequenceRequest, + com.google.showcase.v1beta1.Sequence>( + this, METHODID_CREATE_SEQUENCE))) + .addMethod( + getGetSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport>( + this, METHODID_GET_SEQUENCE_REPORT))) + .addMethod( + getAttemptSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptSequenceRequest, + com.google.protobuf.Empty>( + this, METHODID_ATTEMPT_SEQUENCE))) + .build(); + } + } + + /** + */ + public static final class SequenceServiceStub extends io.grpc.stub.AbstractAsyncStub { + private SequenceServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + + /** + */ + public void createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class SequenceServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + + /** + */ + public com.google.showcase.v1beta1.Sequence createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.protobuf.Empty attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class SequenceServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private SequenceServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SEQUENCE = 0; + private static final int METHODID_GET_SEQUENCE_REPORT = 1; + private static final int METHODID_ATTEMPT_SEQUENCE = 2; + + 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 SequenceServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SequenceServiceImplBase 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_CREATE_SEQUENCE: + serviceImpl.createSequence((com.google.showcase.v1beta1.CreateSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SEQUENCE_REPORT: + serviceImpl.getSequenceReport((com.google.showcase.v1beta1.GetSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ATTEMPT_SEQUENCE: + serviceImpl.attemptSequence((com.google.showcase.v1beta1.AttemptSequenceRequest) 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 static abstract class SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SequenceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SequenceService"); + } + } + + private static final class SequenceServiceFileDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier { + SequenceServiceFileDescriptorSupplier() {} + } + + private static final class SequenceServiceMethodDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SequenceServiceMethodDescriptorSupplier(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 (SequenceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SequenceServiceFileDescriptorSupplier()) + .addMethod(getCreateSequenceMethod()) + .addMethod(getGetSequenceReportMethod()) + .addMethod(getAttemptSequenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java new file mode 100644 index 0000000000..e238c85867 --- /dev/null +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -0,0 +1,794 @@ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: schema/google/showcase/v1beta1/testing.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class TestingGrpc { + + private TestingGrpc() {} + + public static final String SERVICE_NAME = "google.showcase.v1beta1.Testing"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSession", + requestType = com.google.showcase.v1beta1.CreateSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateSessionMethod() { + io.grpc.MethodDescriptor getCreateSessionMethod; + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + TestingGrpc.getCreateSessionMethod = getCreateSessionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("CreateSession")) + .build(); + } + } + } + return getCreateSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSession", + requestType = com.google.showcase.v1beta1.GetSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSessionMethod() { + io.grpc.MethodDescriptor getGetSessionMethod; + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + TestingGrpc.getGetSessionMethod = getGetSessionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("GetSession")) + .build(); + } + } + } + return getGetSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor getListSessionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSessions", + requestType = com.google.showcase.v1beta1.ListSessionsRequest.class, + responseType = com.google.showcase.v1beta1.ListSessionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListSessionsMethod() { + io.grpc.MethodDescriptor getListSessionsMethod; + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + TestingGrpc.getListSessionsMethod = getListSessionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSessions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListSessions")) + .build(); + } + } + } + return getListSessionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSession", + requestType = com.google.showcase.v1beta1.DeleteSessionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteSessionMethod() { + io.grpc.MethodDescriptor getDeleteSessionMethod; + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + TestingGrpc.getDeleteSessionMethod = getDeleteSessionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteSession")) + .build(); + } + } + } + return getDeleteSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor getReportSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReportSession", + requestType = com.google.showcase.v1beta1.ReportSessionRequest.class, + responseType = com.google.showcase.v1beta1.ReportSessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getReportSessionMethod() { + io.grpc.MethodDescriptor getReportSessionMethod; + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + TestingGrpc.getReportSessionMethod = getReportSessionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReportSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ReportSession")) + .build(); + } + } + } + return getReportSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor getListTestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTests", + requestType = com.google.showcase.v1beta1.ListTestsRequest.class, + responseType = com.google.showcase.v1beta1.ListTestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListTestsMethod() { + io.grpc.MethodDescriptor getListTestsMethod; + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + TestingGrpc.getListTestsMethod = getListTestsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListTests")) + .build(); + } + } + } + return getListTestsMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTest", + requestType = com.google.showcase.v1beta1.DeleteTestRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteTestMethod() { + io.grpc.MethodDescriptor getDeleteTestMethod; + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + TestingGrpc.getDeleteTestMethod = getDeleteTestMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteTest")) + .build(); + } + } + } + return getDeleteTestMethod; + } + + private static volatile io.grpc.MethodDescriptor getVerifyTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyTest", + requestType = com.google.showcase.v1beta1.VerifyTestRequest.class, + responseType = com.google.showcase.v1beta1.VerifyTestResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getVerifyTestMethod() { + io.grpc.MethodDescriptor getVerifyTestMethod; + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + TestingGrpc.getVerifyTestMethod = getVerifyTestMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("VerifyTest")) + .build(); + } + } + } + return getVerifyTestMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static TestingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + }; + return TestingStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TestingBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + }; + return TestingBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static TestingFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + }; + return TestingFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class TestingImplBase implements io.grpc.BindableService { + + /** + */ + public void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSessionMethod(), responseObserver); + } + + /** + */ + public void getSession(com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); + } + + /** + */ + public void listSessions(com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSessionsMethod(), responseObserver); + } + + /** + */ + public void deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteSessionMethod(), responseObserver); + } + + /** + */ + public void reportSession(com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReportSessionMethod(), responseObserver); + } + + /** + */ + public void listTests(com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); + } + + /** + */ + public void deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); + } + + /** + */ + public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSessionRequest, + com.google.showcase.v1beta1.Session>( + this, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSessionRequest, + com.google.showcase.v1beta1.Session>( + this, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse>( + this, METHODID_LIST_SESSIONS))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteSessionRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_SESSION))) + .addMethod( + getReportSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse>( + this, METHODID_REPORT_SESSION))) + .addMethod( + getListTestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse>( + this, METHODID_LIST_TESTS))) + .addMethod( + getDeleteTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteTestRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_TEST))) + .addMethod( + getVerifyTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse>( + this, METHODID_VERIFY_TEST))) + .build(); + } + } + + /** + */ + public static final class TestingStub extends io.grpc.stub.AbstractAsyncStub { + private TestingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + + /** + */ + public void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSession(com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listSessions(com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void reportSession(com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listTests(com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class TestingBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + + /** + */ + public com.google.showcase.v1beta1.Session createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.Session getSession(com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.protobuf.Empty deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests(com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.protobuf.Empty deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class TestingFutureStub extends io.grpc.stub.AbstractFutureStub { + private TestingFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSession( + com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listTests( + com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SESSION = 0; + private static final int METHODID_GET_SESSION = 1; + private static final int METHODID_LIST_SESSIONS = 2; + private static final int METHODID_DELETE_SESSION = 3; + private static final int METHODID_REPORT_SESSION = 4; + private static final int METHODID_LIST_TESTS = 5; + private static final int METHODID_DELETE_TEST = 6; + private static final int METHODID_VERIFY_TEST = 7; + + 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 TestingImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TestingImplBase 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_CREATE_SESSION: + serviceImpl.createSession((com.google.showcase.v1beta1.CreateSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SESSION: + serviceImpl.getSession((com.google.showcase.v1beta1.GetSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SESSIONS: + serviceImpl.listSessions((com.google.showcase.v1beta1.ListSessionsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SESSION: + serviceImpl.deleteSession((com.google.showcase.v1beta1.DeleteSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPORT_SESSION: + serviceImpl.reportSession((com.google.showcase.v1beta1.ReportSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_TESTS: + serviceImpl.listTests((com.google.showcase.v1beta1.ListTestsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_TEST: + serviceImpl.deleteTest((com.google.showcase.v1beta1.DeleteTestRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VERIFY_TEST: + serviceImpl.verifyTest((com.google.showcase.v1beta1.VerifyTestRequest) 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 static abstract class TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TestingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Testing"); + } + } + + private static final class TestingFileDescriptorSupplier + extends TestingBaseDescriptorSupplier { + TestingFileDescriptorSupplier() {} + } + + private static final class TestingMethodDescriptorSupplier + extends TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TestingMethodDescriptorSupplier(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 (TestingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TestingFileDescriptorSupplier()) + .addMethod(getCreateSessionMethod()) + .addMethod(getGetSessionMethod()) + .addMethod(getListSessionsMethod()) + .addMethod(getDeleteSessionMethod()) + .addMethod(getReportSessionMethod()) + .addMethod(getListTestsMethod()) + .addMethod(getDeleteTestMethod()) + .addMethod(getVerifyTestMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/showcase/pom.xml b/showcase/pom.xml new file mode 100644 index 0000000000..ebbf95fe22 --- /dev/null +++ b/showcase/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase-parent + pom + 0.0.0-SNAPSHOT + GAPIC Showcase Client Core Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 0.0.0-SNAPSHOT + ./google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-iot-parent + + + + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.0-SNAPSHOT + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.0-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.0-SNAPSHOT + + + + + + gapic-showcase + grpc-gapic-showcase-v1beta1 + proto-gapic-showcase-v1beta1 + + + \ No newline at end of file diff --git a/showcase/proto-gapic-showcase-v1beta1/pom.xml b/showcase/proto-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..1ed8bd5d90 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,64 @@ + + 4.0.0 + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.0-SNAPSHOT + proto-gapic-showcase-v1beta1 + PROTO library for proto-gapic-showcase-v1beta1 + + com.google.cloud + gapic-showcase-parent + 0.0.0-SNAPSHOT + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + generate-showcase + + exec + + generate-sources + + bazel + + run + //showcase:update_proto + + + + + + + + + + + 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 + + + \ No newline at end of file diff --git a/showcase/scripts/BUILD.bazel b/showcase/scripts/BUILD.bazel new file mode 100644 index 0000000000..33ad1e5f23 --- /dev/null +++ b/showcase/scripts/BUILD.bazel @@ -0,0 +1,3 @@ +package(default_visibility = ["//showcase:update"]) + +exports_files(["update.sh"]) diff --git a/showcase/scripts/update.sh b/showcase/scripts/update.sh new file mode 100755 index 0000000000..0f0c56182d --- /dev/null +++ b/showcase/scripts/update.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# This script is executed by ../BUILD.bazel as a final post-generation step. + +set -o errexit +BAZEL_ROOT=$PWD + +clear_existing() { + cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$1" + find . -name '*.java' -not -path '*/it/*' -delete + find . -name 'gapic_metadata.json' -delete + cd - +} +create_unpack_dir() { + cd "$BAZEL_ROOT" + rm -rf "$1" + mkdir "$1" + cd "$1" +} + +case $1 in + proto) + PROTO_PROJECT_DIR=proto-gapic-showcase-v1beta1 + PROTO_ARCHIVE=$(find . -name 'proto-google-cloud-showcase-v1beta1-java.tar.gz') + clear_existing $PROTO_PROJECT_DIR + create_unpack_dir proto_unpacked + PROTO_UNPACK_DIR=$PWD + + tar -xzf "../$PROTO_ARCHIVE" + cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$PROTO_PROJECT_DIR" + mkdir -p ./src + cp -r "$PROTO_UNPACK_DIR"/proto-google-cloud-showcase-v1beta1-java/src/* ./src + ;; + + grpc) + GRPC_PROJECT_DIR=grpc-gapic-showcase-v1beta1 + GRPC_JAR=$(find . -name 'libshowcase_java_grpc-src.jar') + clear_existing $PROTO_PROJECT_DIR + create_unpack_dir grpc_unpacked + GRPC_UNPACK_DIR=$PWD + + jar xf "../$GRPC_JAR" + cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$GRPC_PROJECT_DIR" + mkdir -p ./src/main/java/com + cp -r "$GRPC_UNPACK_DIR"/com/* ./src/main/java/com + ;; + + gapic) + GAPIC_PROJECT_DIR=gapic-showcase + GAPIC_JAR=$(find . -name 'showcase_java_gapic_srcjar_raw.srcjar') + clear_existing $GAPIC_PROJECT_DIR + create_unpack_dir gapic_unpacked + GAPIC_UNPACK_DIR=$PWD + + unzip -q -c "../$GAPIC_JAR" temp-codegen.srcjar | jar x + cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$GAPIC_PROJECT_DIR" + mkdir -p ./src + cp -r "$GAPIC_UNPACK_DIR"/src/* ./src + ;; +esac + +cd "${BUILD_WORKSPACE_DIRECTORY}/showcase" +find . -name '.DS_Store' -delete +find . -name 'PlaceholderFile.java' -delete +find . -type d -empty -delete From 968840730a53a016e056562a748859c081f0c679 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 29 Nov 2022 17:00:34 -0500 Subject: [PATCH 10/40] chore: relocate gapic-generator-java pom.xml to subfolder --- gapic-generator-java/pom.xml | 387 ++++++++++++++++++ pom.xml | 349 +--------------- .../engine/JavaCodeGeneratorTest.java | 3 +- .../composer/common/TestProtoLoader.java | 2 +- .../composer/grpc/GrpcTestProtoLoader.java | 3 +- .../gapic/model/GapicServiceConfigTest.java | 3 +- .../protoparser/ServiceYamlParserTest.java | 3 +- .../api/generator/test/framework/Utils.java | 8 +- 8 files changed, 415 insertions(+), 343 deletions(-) create mode 100644 gapic-generator-java/pom.xml diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml new file mode 100644 index 0000000000..7bceacbe7c --- /dev/null +++ b/gapic-generator-java/pom.xml @@ -0,0 +1,387 @@ + + 4.0.0 + com.google.api + gapic-generator-java + 0.0.1-SNAPSHOT + + + UTF-8 + + 44d6bef0ca6db8bba3fb324c8186e694bcc4829c + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.0.6 + pom + import + + + + + + ../src/main/java + + + ../src/ + + + ../src/test/java + ../target + + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + + + + + maven-compiler-plugin + 3.10.1 + + 8 + 8 + + + com.google.auto.value + auto-value + 1.10.1 + + + + + + + com.coveo + fmt-maven-plugin + 2.9.1 + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.8 + + + download-metadata-proto + generate-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/gapic/metadata/gapic_metadata.proto + + ../target/generated-sources/proto + + + + download-common-resources-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/cloud/common_resources.proto + + ../target/generated-test-sources/proto + + + + download-pubsub-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/pubsub.proto + + ../target/generated-test-sources/proto + + + + download-schema-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/schema.proto + + ../target/generated-test-sources/proto/google/pubsub/v1 + + + + + download-logging-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging.proto + + ../target/generated-test-sources/proto + + + + download-log-entry-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/log_entry.proto + + ../target/generated-test-sources/proto/google/logging/v2 + + + + + download-logging-config-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_config.proto + + ../target/generated-test-sources/proto/google/logging/v2 + + + + + download-logging-metrics-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_metrics.proto + + ../target/generated-test-sources/proto/google/logging/v2 + + + + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier} + + + + + compile-protos + + compile + + + ../src/main/proto + + + + compile-downloaded-protos + + compile + + + ../target/generated-sources/proto + false + + + + compile-test-protos + + test-compile + + + ../src/test/proto + true + true + true + test-proto.descriptorset + + + + compile-downloaded-test-protos + + test-compile + + + ../target/generated-test-sources/proto + false + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M7 + + + + ../target/generated-test-resources/protobuf/descriptor-sets + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + + prepare-agent + + + + report + test + + report + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.4.1 + + + package + + shade + + + false + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax + testlib + + + com.google.api + gax-grpc + + + com.google.api + gax-grpc + testlib + + + com.google.api + gax-httpjson + + + com.google.api + gax-httpjson + testlib + + + com.google.auto.value + auto-value-annotations + + + com.google.protobuf + protobuf-java-util + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + org.yaml + snakeyaml + 1.33 + + + com.google.googlejavaformat + google-java-format + 1.7 + + + junit + junit + 4.13.2 + + + + + javax.annotation + javax.annotation-api + + + + com.google.truth + truth + 1.1.3 + test + + + io.github.java-diff-utils + java-diff-utils + 4.12 + test + + + diff --git a/pom.xml b/pom.xml index 83c2575efa..2dd125a152 100644 --- a/pom.xml +++ b/pom.xml @@ -1,349 +1,28 @@ - + + 4.0.0 com.google.api - gapic-generator-java + gapic-generator-java-parent 0.0.1-SNAPSHOT + pom - - UTF-8 - - 44d6bef0ca6db8bba3fb324c8186e694bcc4829c - - - - - - com.google.cloud - google-cloud-shared-dependencies - 3.0.6 - pom - import - - - + + gapic-generator-java + + - - - kr.motd.maven - os-maven-plugin - 1.7.1 - - - - - maven-compiler-plugin - 3.10.1 - - 8 - 8 - - - com.google.auto.value - auto-value - 1.10.1 - - - - - - - com.coveo - fmt-maven-plugin - 2.9.1 - - - - com.googlecode.maven-download-plugin - download-maven-plugin - 1.6.8 - - - download-metadata-proto - generate-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/gapic/metadata/gapic_metadata.proto - ${project.build.directory}/generated-sources/proto/ - - - - download-common-resources-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/cloud/common_resources.proto - ${project.build.directory}/generated-test-sources/proto/ - - - - download-pubsub-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/pubsub.proto - ${project.build.directory}/generated-test-sources/proto/ - - - - download-schema-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/schema.proto - ${project.build.directory}/generated-test-sources/proto/google/pubsub/v1/ - - - - download-logging-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging.proto - ${project.build.directory}/generated-test-sources/proto/ - - - - download-log-entry-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/log_entry.proto - ${project.build.directory}/generated-test-sources/proto/google/logging/v2/ - - - - download-logging-config-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_config.proto - ${project.build.directory}/generated-test-sources/proto/google/logging/v2/ - - - - download-logging-metrics-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_metrics.proto - ${project.build.directory}/generated-test-sources/proto/google/logging/v2/ - - - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier} - - - - compile-protos - - compile - - - - compile-downloaded-protos - - compile - - - ${project.build.directory}/generated-sources/proto/ - false - - - - compile-test-protos - - test-compile - - - true - true - true - test-proto.descriptorset - - - - compile-downloaded-test-protos - - test-compile - - - ${project.build.directory}/generated-test-sources/proto/ - false - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M7 + maven-deploy-plugin + 3.0.0 - - ${project.build.directory}/generated-test-resources/protobuf/descriptor-sets/ - + true - - - - org.jacoco - jacoco-maven-plugin - 0.8.8 - - - - prepare-agent - - - - report - test - - report - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.4.1 - - - package - - shade - - - false - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - - - - com.google.guava - guava - - - com.google.api - gax - - - com.google.api - gax - testlib - - - com.google.api - gax-grpc - - - com.google.api - gax-grpc - testlib - - - com.google.api - gax-httpjson - - - com.google.api - gax-httpjson - testlib - - - com.google.auto.value - auto-value-annotations - - - com.google.protobuf - protobuf-java-util - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - org.yaml - snakeyaml - 1.33 - - - com.google.googlejavaformat - google-java-format - 1.7 - - - junit - junit - 4.13.2 - - - - - javax.annotation - javax.annotation-api - - - - com.google.truth - truth - 1.1.3 - test - - - io.github.java-diff-utils - java-diff-utils - 4.12 - test - - - + \ No newline at end of file diff --git a/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java b/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java index 607ccd89f6..dbcacf387a 100644 --- a/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java +++ b/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java @@ -63,8 +63,9 @@ import org.junit.Test; public class JavaCodeGeneratorTest { + private static final String GOLDENFILES_DIRECTORY = - "src/test/java/com/google/api/generator/engine/goldens/"; + "../src/test/java/com/google/api/generator/engine/goldens/"; // Create shared VaporReferences. private static final VaporReference stubRef = createVaporReference("com.google.gax.grpc", "Stub"); private static final VaporReference bookKindRef = diff --git a/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java b/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java index 4df5052b6b..dc18436221 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java +++ b/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java @@ -56,7 +56,7 @@ public class TestProtoLoader { private static final TestProtoLoader INSTANCE = - new TestProtoLoader(Transport.GRPC, "src/test/resources/"); + new TestProtoLoader(Transport.GRPC, "../src/test/resources/"); private static final String ECHO_SERVICE_DESCRIPTION = "This service is used showcase the four main types of rpcs - unary, server\n" + " side streaming, client side streaming, and bidirectional streaming. This\n" diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java index 7270a2f14b..42b3abf929 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java @@ -18,10 +18,11 @@ import com.google.api.generator.gapic.model.Transport; public class GrpcTestProtoLoader extends TestProtoLoader { + private static final GrpcTestProtoLoader INSTANCE = new GrpcTestProtoLoader(); protected GrpcTestProtoLoader() { - super(Transport.GRPC, "src/test/resources/"); + super(Transport.GRPC, "../src/test/resources/"); } public static GrpcTestProtoLoader instance() { diff --git a/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java b/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java index d7aefc8733..945fe2e9a7 100644 --- a/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java +++ b/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java @@ -37,8 +37,9 @@ import org.junit.Test; public class GapicServiceConfigTest { + private static final double EPSILON = 1e-4; - private static final String TESTDATA_DIRECTORY = "src/test/resources/"; + private static final String TESTDATA_DIRECTORY = "../src/test/resources/"; @Test public void serviceConfig_noConfigsFound() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java index dd38903051..16f37a5baf 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java @@ -23,7 +23,8 @@ import org.junit.Test; public class ServiceYamlParserTest { - private static final String YAML_DIRECTORY = "src/test/resources/"; + + private static final String YAML_DIRECTORY = "../src/test/resources/"; @Test public void parseServiceYaml_basic() { diff --git a/src/test/java/com/google/api/generator/test/framework/Utils.java b/src/test/java/com/google/api/generator/test/framework/Utils.java index cb423046fb..8d6c0dc190 100644 --- a/src/test/java/com/google/api/generator/test/framework/Utils.java +++ b/src/test/java/com/google/api/generator/test/framework/Utils.java @@ -20,6 +20,7 @@ import java.nio.file.Paths; public class Utils { + /** * Save the generated code from JUnit test to a file for updating goldens. The relative path * `com/google/..` which is identical with the location of goldens files which will help us easily @@ -28,9 +29,9 @@ public class Utils { * generated code into a file called `ComposerTest.golden` at * `src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerTest.golden`. * - * @param clazz the test class. + * @param clazz the test class. * @param fileName the name of saved file, usually a test method name with suffix `.golden` - * @param codegen the generated code from JUnit test + * @param codegen the generated code from JUnit test */ public static void saveCodegenToFile(Class clazz, String fileName, String codegen) { String relativeGoldenDir = getTestoutGoldenDir(clazz); @@ -70,10 +71,11 @@ private static String getTestoutGoldenDir(Class clazz) { } public static String getGoldenDir(Class clazz) { - return "src/test/java/" + getTestoutGoldenDir(clazz); + return "../src/test/java/" + getTestoutGoldenDir(clazz); } public static class SaveCodegenToFileException extends RuntimeException { + public SaveCodegenToFileException(String errorMessage) { super(errorMessage); } From e5d38951040aa21818dd59223df17ff30d7dbb0a Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 29 Nov 2022 17:25:54 -0500 Subject: [PATCH 11/40] fix: ensure all tests work with new project structure --- .gitignore | 1 + pom.xml | 5 ++++ .../BatchingSettingsConfigParserTest.java | 3 ++- .../GapicLanguageSettingsParserTest.java | 3 ++- .../GapicLroRetrySettingsParserTest.java | 3 ++- .../protoparser/ServiceConfigParserTest.java | 3 ++- .../protoparser/SourceCodeInfoParserTest.java | 25 +++++++++++++------ .../api/generator/test/framework/Utils.java | 4 +-- 8 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 913a2a8e6e..3b7b1a4ed2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ target/ # IDE .idea .ijwb +*.iml # Vim. *.sw* diff --git a/pom.xml b/pom.xml index 2dd125a152..ad31faffd7 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,11 @@ true + + com.coveo + fmt-maven-plugin + 2.9.1 + \ No newline at end of file diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java index 3dfc6373c0..fcaaad3706 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java @@ -27,7 +27,8 @@ import org.junit.Test; public class BatchingSettingsConfigParserTest { - private static final String YAML_DIRECTORY = "src/test/resources/"; + + private static final String YAML_DIRECTORY = "../src/test/resources/"; @Test public void parseGapicSettings_plain() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java index 3a6fbed745..076251788d 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java @@ -24,7 +24,8 @@ import org.junit.Test; public class GapicLanguageSettingsParserTest { - private static final String YAML_DIRECTORY = "src/test/resources/"; + + private static final String YAML_DIRECTORY = "../src/test/resources/"; @Test public void parseLanguageSettings_onlyInterfacePresent() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java index 37eb4bdd5f..a29eed06a7 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java @@ -25,8 +25,9 @@ import org.junit.Test; public class GapicLroRetrySettingsParserTest { + private static final double DELTA = 0.0001; - private static final String YAML_DIRECTORY = "src/test/resources/"; + private static final String YAML_DIRECTORY = "../src/test/resources/"; @Test public void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java index 6d9318969e..7062b361eb 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java @@ -28,7 +28,8 @@ import org.junit.Test; public class ServiceConfigParserTest { - private static final String JSON_DIRECTORY = "src/test/resources/"; + + private static final String JSON_DIRECTORY = "../src/test/resources/"; private static final double EPSILON = 1e-4; @Test diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java index 36ca5d15f8..e92fb11dac 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java @@ -25,14 +25,18 @@ import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; -import java.io.FileInputStream; +import java.io.IOException; import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import org.junit.Before; import org.junit.Test; public class SourceCodeInfoParserTest { + private static final String BASIC_PROTO = "basic.proto"; private static final String PROTO_DESCRIPTOR_SET = "test-proto.descriptorset"; @@ -151,12 +155,7 @@ public void getOnoeofInfo() { * @return the top level target protoFile descriptor */ private static FileDescriptor buildFileDescriptor() throws Exception { - InputStream testProto = - SourceCodeInfoParserTest.class.getClassLoader().getResourceAsStream(PROTO_DESCRIPTOR_SET); - if (testProto == null) { // TODO: only for Bazel build. Remove when we don't build with Bazel. - testProto = new FileInputStream(PROTO_DESCRIPTOR_SET); - } - try (InputStream in = testProto) { + try (InputStream in = newDescriptorSetInputStream()) { List protoFileList = FileDescriptorSet.parseFrom(in).getFileList(); List deps = new ArrayList<>(); for (FileDescriptorProto proto : protoFileList) { @@ -170,4 +169,16 @@ private static FileDescriptor buildFileDescriptor() throws Exception { } return null; } + + private static InputStream newDescriptorSetInputStream() throws IOException { + Path path = + Paths.get( + "../target/generated-test-resources/protobuf/descriptor-sets", PROTO_DESCRIPTOR_SET); + + if (path.toFile().exists()) { + return Files.newInputStream(path); + } + // TODO: only for Bazel build. Remove when we don't build with Bazel. + return Files.newInputStream(Paths.get(PROTO_DESCRIPTOR_SET)); + } } diff --git a/src/test/java/com/google/api/generator/test/framework/Utils.java b/src/test/java/com/google/api/generator/test/framework/Utils.java index 8d6c0dc190..4c500ef091 100644 --- a/src/test/java/com/google/api/generator/test/framework/Utils.java +++ b/src/test/java/com/google/api/generator/test/framework/Utils.java @@ -29,9 +29,9 @@ public class Utils { * generated code into a file called `ComposerTest.golden` at * `src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerTest.golden`. * - * @param clazz the test class. + * @param clazz the test class. * @param fileName the name of saved file, usually a test method name with suffix `.golden` - * @param codegen the generated code from JUnit test + * @param codegen the generated code from JUnit test */ public static void saveCodegenToFile(Class clazz, String fileName, String codegen) { String relativeGoldenDir = getTestoutGoldenDir(clazz); From 9bf98f4acfa22b50993150e0c72678b5d7b6e37b Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Wed, 30 Nov 2022 11:51:53 -0500 Subject: [PATCH 12/40] fix: set surefire working directory, and revert source adjustments --- gapic-generator-java/pom.xml | 1 + .../google/api/generator/engine/JavaCodeGeneratorTest.java | 2 +- .../generator/gapic/composer/common/TestProtoLoader.java | 2 +- .../generator/gapic/composer/grpc/GrpcTestProtoLoader.java | 2 +- .../api/generator/gapic/model/GapicServiceConfigTest.java | 2 +- .../gapic/protoparser/BatchingSettingsConfigParserTest.java | 2 +- .../gapic/protoparser/GapicLanguageSettingsParserTest.java | 2 +- .../gapic/protoparser/GapicLroRetrySettingsParserTest.java | 2 +- .../gapic/protoparser/ServiceConfigParserTest.java | 2 +- .../generator/gapic/protoparser/ServiceYamlParserTest.java | 2 +- .../gapic/protoparser/SourceCodeInfoParserTest.java | 2 +- .../java/com/google/api/generator/test/framework/Utils.java | 6 +++--- src/test/java/com/google/api/generator/util/TestUtils.java | 1 + 13 files changed, 15 insertions(+), 13 deletions(-) diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 7bceacbe7c..deb40e1031 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -245,6 +245,7 @@ ../target/generated-test-resources/protobuf/descriptor-sets + ../ diff --git a/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java b/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java index dbcacf387a..3bbc0808de 100644 --- a/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java +++ b/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java @@ -65,7 +65,7 @@ public class JavaCodeGeneratorTest { private static final String GOLDENFILES_DIRECTORY = - "../src/test/java/com/google/api/generator/engine/goldens/"; + "src/test/java/com/google/api/generator/engine/goldens/"; // Create shared VaporReferences. private static final VaporReference stubRef = createVaporReference("com.google.gax.grpc", "Stub"); private static final VaporReference bookKindRef = diff --git a/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java b/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java index dc18436221..4df5052b6b 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java +++ b/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java @@ -56,7 +56,7 @@ public class TestProtoLoader { private static final TestProtoLoader INSTANCE = - new TestProtoLoader(Transport.GRPC, "../src/test/resources/"); + new TestProtoLoader(Transport.GRPC, "src/test/resources/"); private static final String ECHO_SERVICE_DESCRIPTION = "This service is used showcase the four main types of rpcs - unary, server\n" + " side streaming, client side streaming, and bidirectional streaming. This\n" diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java index 42b3abf929..c6249121e5 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java @@ -22,7 +22,7 @@ public class GrpcTestProtoLoader extends TestProtoLoader { private static final GrpcTestProtoLoader INSTANCE = new GrpcTestProtoLoader(); protected GrpcTestProtoLoader() { - super(Transport.GRPC, "../src/test/resources/"); + super(Transport.GRPC, "src/test/resources/"); } public static GrpcTestProtoLoader instance() { diff --git a/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java b/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java index 945fe2e9a7..ca4cd84418 100644 --- a/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java +++ b/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java @@ -39,7 +39,7 @@ public class GapicServiceConfigTest { private static final double EPSILON = 1e-4; - private static final String TESTDATA_DIRECTORY = "../src/test/resources/"; + private static final String TESTDATA_DIRECTORY = "src/test/resources/"; @Test public void serviceConfig_noConfigsFound() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java index fcaaad3706..3430c2585d 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java @@ -28,7 +28,7 @@ public class BatchingSettingsConfigParserTest { - private static final String YAML_DIRECTORY = "../src/test/resources/"; + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test public void parseGapicSettings_plain() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java index 076251788d..868231d516 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java @@ -25,7 +25,7 @@ public class GapicLanguageSettingsParserTest { - private static final String YAML_DIRECTORY = "../src/test/resources/"; + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test public void parseLanguageSettings_onlyInterfacePresent() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java index a29eed06a7..0c7f8e7d82 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java @@ -27,7 +27,7 @@ public class GapicLroRetrySettingsParserTest { private static final double DELTA = 0.0001; - private static final String YAML_DIRECTORY = "../src/test/resources/"; + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test public void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java index 7062b361eb..8a27f7fd4f 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java @@ -29,7 +29,7 @@ public class ServiceConfigParserTest { - private static final String JSON_DIRECTORY = "../src/test/resources/"; + private static final String JSON_DIRECTORY = "src/test/resources/"; private static final double EPSILON = 1e-4; @Test diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java index 16f37a5baf..8df9ddcf84 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java @@ -24,7 +24,7 @@ public class ServiceYamlParserTest { - private static final String YAML_DIRECTORY = "../src/test/resources/"; + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test public void parseServiceYaml_basic() { diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java index e92fb11dac..be485eccd6 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java @@ -173,7 +173,7 @@ private static FileDescriptor buildFileDescriptor() throws Exception { private static InputStream newDescriptorSetInputStream() throws IOException { Path path = Paths.get( - "../target/generated-test-resources/protobuf/descriptor-sets", PROTO_DESCRIPTOR_SET); + "target/generated-test-resources/protobuf/descriptor-sets", PROTO_DESCRIPTOR_SET); if (path.toFile().exists()) { return Files.newInputStream(path); diff --git a/src/test/java/com/google/api/generator/test/framework/Utils.java b/src/test/java/com/google/api/generator/test/framework/Utils.java index 4c500ef091..f397fa4a4f 100644 --- a/src/test/java/com/google/api/generator/test/framework/Utils.java +++ b/src/test/java/com/google/api/generator/test/framework/Utils.java @@ -29,9 +29,9 @@ public class Utils { * generated code into a file called `ComposerTest.golden` at * `src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerTest.golden`. * - * @param clazz the test class. + * @param clazz the test class. * @param fileName the name of saved file, usually a test method name with suffix `.golden` - * @param codegen the generated code from JUnit test + * @param codegen the generated code from JUnit test */ public static void saveCodegenToFile(Class clazz, String fileName, String codegen) { String relativeGoldenDir = getTestoutGoldenDir(clazz); @@ -71,7 +71,7 @@ private static String getTestoutGoldenDir(Class clazz) { } public static String getGoldenDir(Class clazz) { - return "../src/test/java/" + getTestoutGoldenDir(clazz); + return "src/test/java/" + getTestoutGoldenDir(clazz); } public static class SaveCodegenToFileException extends RuntimeException { diff --git a/src/test/java/com/google/api/generator/util/TestUtils.java b/src/test/java/com/google/api/generator/util/TestUtils.java index 87ccb5832d..ee509e0fee 100644 --- a/src/test/java/com/google/api/generator/util/TestUtils.java +++ b/src/test/java/com/google/api/generator/util/TestUtils.java @@ -23,6 +23,7 @@ import com.google.api.generator.engine.ast.VariableExpr; public class TestUtils { + public static ValueExpr generateStringValueExpr(String value) { return ValueExpr.builder().setValue(StringObjectValue.withValue(value)).build(); } From 15200c0f989f2a0ba9f734d7068294fa46b1b0aa Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Wed, 30 Nov 2022 11:54:52 -0500 Subject: [PATCH 13/40] fix: formatter --- .../generator/gapic/protoparser/SourceCodeInfoParserTest.java | 3 +-- .../java/com/google/api/generator/test/framework/Utils.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java index be485eccd6..40b9eb12f0 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java @@ -172,8 +172,7 @@ private static FileDescriptor buildFileDescriptor() throws Exception { private static InputStream newDescriptorSetInputStream() throws IOException { Path path = - Paths.get( - "target/generated-test-resources/protobuf/descriptor-sets", PROTO_DESCRIPTOR_SET); + Paths.get("target/generated-test-resources/protobuf/descriptor-sets", PROTO_DESCRIPTOR_SET); if (path.toFile().exists()) { return Files.newInputStream(path); diff --git a/src/test/java/com/google/api/generator/test/framework/Utils.java b/src/test/java/com/google/api/generator/test/framework/Utils.java index f397fa4a4f..5960b722ef 100644 --- a/src/test/java/com/google/api/generator/test/framework/Utils.java +++ b/src/test/java/com/google/api/generator/test/framework/Utils.java @@ -29,9 +29,9 @@ public class Utils { * generated code into a file called `ComposerTest.golden` at * `src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerTest.golden`. * - * @param clazz the test class. + * @param clazz the test class. * @param fileName the name of saved file, usually a test method name with suffix `.golden` - * @param codegen the generated code from JUnit test + * @param codegen the generated code from JUnit test */ public static void saveCodegenToFile(Class clazz, String fileName, String codegen) { String relativeGoldenDir = getTestoutGoldenDir(clazz); From dbf9342144ddfd9c61fa551ec88ed76509a013ef Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Wed, 30 Nov 2022 13:26:42 -0500 Subject: [PATCH 14/40] chore: relocate gapic-generator-java pom.xml to subfolder (#1105) * chore: relocate gapic-generator-java pom.xml to subfolder * fix: ensure all tests work with new project structure * fix: set surefire working directory, and revert source adjustments * fix: formatter --- .gitignore | 1 + gapic-generator-java/pom.xml | 388 ++++++++++++++++++ pom.xml | 346 +--------------- .../engine/JavaCodeGeneratorTest.java | 1 + .../composer/grpc/GrpcTestProtoLoader.java | 1 + .../gapic/model/GapicServiceConfigTest.java | 1 + .../BatchingSettingsConfigParserTest.java | 1 + .../GapicLanguageSettingsParserTest.java | 1 + .../GapicLroRetrySettingsParserTest.java | 1 + .../protoparser/ServiceConfigParserTest.java | 1 + .../protoparser/ServiceYamlParserTest.java | 1 + .../protoparser/SourceCodeInfoParserTest.java | 24 +- .../api/generator/test/framework/Utils.java | 2 + .../google/api/generator/util/TestUtils.java | 1 + 14 files changed, 432 insertions(+), 338 deletions(-) create mode 100644 gapic-generator-java/pom.xml diff --git a/.gitignore b/.gitignore index 913a2a8e6e..3b7b1a4ed2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ target/ # IDE .idea .ijwb +*.iml # Vim. *.sw* diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml new file mode 100644 index 0000000000..deb40e1031 --- /dev/null +++ b/gapic-generator-java/pom.xml @@ -0,0 +1,388 @@ + + 4.0.0 + com.google.api + gapic-generator-java + 0.0.1-SNAPSHOT + + + UTF-8 + + 44d6bef0ca6db8bba3fb324c8186e694bcc4829c + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.0.6 + pom + import + + + + + + ../src/main/java + + + ../src/ + + + ../src/test/java + ../target + + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + + + + + maven-compiler-plugin + 3.10.1 + + 8 + 8 + + + com.google.auto.value + auto-value + 1.10.1 + + + + + + + com.coveo + fmt-maven-plugin + 2.9.1 + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.8 + + + download-metadata-proto + generate-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/gapic/metadata/gapic_metadata.proto + + ../target/generated-sources/proto + + + + download-common-resources-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/cloud/common_resources.proto + + ../target/generated-test-sources/proto + + + + download-pubsub-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/pubsub.proto + + ../target/generated-test-sources/proto + + + + download-schema-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/schema.proto + + ../target/generated-test-sources/proto/google/pubsub/v1 + + + + + download-logging-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging.proto + + ../target/generated-test-sources/proto + + + + download-log-entry-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/log_entry.proto + + ../target/generated-test-sources/proto/google/logging/v2 + + + + + download-logging-config-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_config.proto + + ../target/generated-test-sources/proto/google/logging/v2 + + + + + download-logging-metrics-proto + generate-test-sources + + wget + + + + https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_metrics.proto + + ../target/generated-test-sources/proto/google/logging/v2 + + + + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier} + + + + + compile-protos + + compile + + + ../src/main/proto + + + + compile-downloaded-protos + + compile + + + ../target/generated-sources/proto + false + + + + compile-test-protos + + test-compile + + + ../src/test/proto + true + true + true + test-proto.descriptorset + + + + compile-downloaded-test-protos + + test-compile + + + ../target/generated-test-sources/proto + false + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M7 + + + + ../target/generated-test-resources/protobuf/descriptor-sets + + + ../ + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + + prepare-agent + + + + report + test + + report + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.4.1 + + + package + + shade + + + false + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax + testlib + + + com.google.api + gax-grpc + + + com.google.api + gax-grpc + testlib + + + com.google.api + gax-httpjson + + + com.google.api + gax-httpjson + testlib + + + com.google.auto.value + auto-value-annotations + + + com.google.protobuf + protobuf-java-util + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + org.yaml + snakeyaml + 1.33 + + + com.google.googlejavaformat + google-java-format + 1.7 + + + junit + junit + 4.13.2 + + + + + javax.annotation + javax.annotation-api + + + + com.google.truth + truth + 1.1.3 + test + + + io.github.java-diff-utils + java-diff-utils + 4.12 + test + + + diff --git a/pom.xml b/pom.xml index 83c2575efa..ad31faffd7 100644 --- a/pom.xml +++ b/pom.xml @@ -1,349 +1,33 @@ - + + 4.0.0 com.google.api - gapic-generator-java + gapic-generator-java-parent 0.0.1-SNAPSHOT + pom - - UTF-8 - - 44d6bef0ca6db8bba3fb324c8186e694bcc4829c - - - - - - com.google.cloud - google-cloud-shared-dependencies - 3.0.6 - pom - import - - - + + gapic-generator-java + + - - - kr.motd.maven - os-maven-plugin - 1.7.1 - - - - maven-compiler-plugin - 3.10.1 + org.apache.maven.plugins + maven-deploy-plugin + 3.0.0 - 8 - 8 - - - com.google.auto.value - auto-value - 1.10.1 - - + true - com.coveo fmt-maven-plugin 2.9.1 - - - com.googlecode.maven-download-plugin - download-maven-plugin - 1.6.8 - - - download-metadata-proto - generate-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/gapic/metadata/gapic_metadata.proto - ${project.build.directory}/generated-sources/proto/ - - - - download-common-resources-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/cloud/common_resources.proto - ${project.build.directory}/generated-test-sources/proto/ - - - - download-pubsub-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/pubsub.proto - ${project.build.directory}/generated-test-sources/proto/ - - - - download-schema-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/schema.proto - ${project.build.directory}/generated-test-sources/proto/google/pubsub/v1/ - - - - download-logging-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging.proto - ${project.build.directory}/generated-test-sources/proto/ - - - - download-log-entry-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/log_entry.proto - ${project.build.directory}/generated-test-sources/proto/google/logging/v2/ - - - - download-logging-config-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_config.proto - ${project.build.directory}/generated-test-sources/proto/google/logging/v2/ - - - - download-logging-metrics-proto - generate-test-sources - - wget - - - https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_metrics.proto - ${project.build.directory}/generated-test-sources/proto/google/logging/v2/ - - - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier} - - - - compile-protos - - compile - - - - compile-downloaded-protos - - compile - - - ${project.build.directory}/generated-sources/proto/ - false - - - - compile-test-protos - - test-compile - - - true - true - true - test-proto.descriptorset - - - - compile-downloaded-test-protos - - test-compile - - - ${project.build.directory}/generated-test-sources/proto/ - false - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M7 - - - ${project.build.directory}/generated-test-resources/protobuf/descriptor-sets/ - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.8 - - - - prepare-agent - - - - report - test - - report - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.4.1 - - - package - - shade - - - false - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - - - - com.google.guava - guava - - - com.google.api - gax - - - com.google.api - gax - testlib - - - com.google.api - gax-grpc - - - com.google.api - gax-grpc - testlib - - - com.google.api - gax-httpjson - - - com.google.api - gax-httpjson - testlib - - - com.google.auto.value - auto-value-annotations - - - com.google.protobuf - protobuf-java-util - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - org.yaml - snakeyaml - 1.33 - - - com.google.googlejavaformat - google-java-format - 1.7 - - - junit - junit - 4.13.2 - - - - - javax.annotation - javax.annotation-api - - - - com.google.truth - truth - 1.1.3 - test - - - io.github.java-diff-utils - java-diff-utils - 4.12 - test - - - + \ No newline at end of file diff --git a/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java b/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java index 607ccd89f6..3bbc0808de 100644 --- a/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java +++ b/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java @@ -63,6 +63,7 @@ import org.junit.Test; public class JavaCodeGeneratorTest { + private static final String GOLDENFILES_DIRECTORY = "src/test/java/com/google/api/generator/engine/goldens/"; // Create shared VaporReferences. diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java index 7270a2f14b..c6249121e5 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java @@ -18,6 +18,7 @@ import com.google.api.generator.gapic.model.Transport; public class GrpcTestProtoLoader extends TestProtoLoader { + private static final GrpcTestProtoLoader INSTANCE = new GrpcTestProtoLoader(); protected GrpcTestProtoLoader() { diff --git a/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java b/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java index d7aefc8733..ca4cd84418 100644 --- a/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java +++ b/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java @@ -37,6 +37,7 @@ import org.junit.Test; public class GapicServiceConfigTest { + private static final double EPSILON = 1e-4; private static final String TESTDATA_DIRECTORY = "src/test/resources/"; diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java index 3dfc6373c0..3430c2585d 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java @@ -27,6 +27,7 @@ import org.junit.Test; public class BatchingSettingsConfigParserTest { + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java index 3a6fbed745..868231d516 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java @@ -24,6 +24,7 @@ import org.junit.Test; public class GapicLanguageSettingsParserTest { + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java index 37eb4bdd5f..0c7f8e7d82 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java @@ -25,6 +25,7 @@ import org.junit.Test; public class GapicLroRetrySettingsParserTest { + private static final double DELTA = 0.0001; private static final String YAML_DIRECTORY = "src/test/resources/"; diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java index 6d9318969e..8a27f7fd4f 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java @@ -28,6 +28,7 @@ import org.junit.Test; public class ServiceConfigParserTest { + private static final String JSON_DIRECTORY = "src/test/resources/"; private static final double EPSILON = 1e-4; diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java index dd38903051..8df9ddcf84 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java @@ -23,6 +23,7 @@ import org.junit.Test; public class ServiceYamlParserTest { + private static final String YAML_DIRECTORY = "src/test/resources/"; @Test diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java index 36ca5d15f8..40b9eb12f0 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java @@ -25,14 +25,18 @@ import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; -import java.io.FileInputStream; +import java.io.IOException; import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import org.junit.Before; import org.junit.Test; public class SourceCodeInfoParserTest { + private static final String BASIC_PROTO = "basic.proto"; private static final String PROTO_DESCRIPTOR_SET = "test-proto.descriptorset"; @@ -151,12 +155,7 @@ public void getOnoeofInfo() { * @return the top level target protoFile descriptor */ private static FileDescriptor buildFileDescriptor() throws Exception { - InputStream testProto = - SourceCodeInfoParserTest.class.getClassLoader().getResourceAsStream(PROTO_DESCRIPTOR_SET); - if (testProto == null) { // TODO: only for Bazel build. Remove when we don't build with Bazel. - testProto = new FileInputStream(PROTO_DESCRIPTOR_SET); - } - try (InputStream in = testProto) { + try (InputStream in = newDescriptorSetInputStream()) { List protoFileList = FileDescriptorSet.parseFrom(in).getFileList(); List deps = new ArrayList<>(); for (FileDescriptorProto proto : protoFileList) { @@ -170,4 +169,15 @@ private static FileDescriptor buildFileDescriptor() throws Exception { } return null; } + + private static InputStream newDescriptorSetInputStream() throws IOException { + Path path = + Paths.get("target/generated-test-resources/protobuf/descriptor-sets", PROTO_DESCRIPTOR_SET); + + if (path.toFile().exists()) { + return Files.newInputStream(path); + } + // TODO: only for Bazel build. Remove when we don't build with Bazel. + return Files.newInputStream(Paths.get(PROTO_DESCRIPTOR_SET)); + } } diff --git a/src/test/java/com/google/api/generator/test/framework/Utils.java b/src/test/java/com/google/api/generator/test/framework/Utils.java index cb423046fb..5960b722ef 100644 --- a/src/test/java/com/google/api/generator/test/framework/Utils.java +++ b/src/test/java/com/google/api/generator/test/framework/Utils.java @@ -20,6 +20,7 @@ import java.nio.file.Paths; public class Utils { + /** * Save the generated code from JUnit test to a file for updating goldens. The relative path * `com/google/..` which is identical with the location of goldens files which will help us easily @@ -74,6 +75,7 @@ public static String getGoldenDir(Class clazz) { } public static class SaveCodegenToFileException extends RuntimeException { + public SaveCodegenToFileException(String errorMessage) { super(errorMessage); } diff --git a/src/test/java/com/google/api/generator/util/TestUtils.java b/src/test/java/com/google/api/generator/util/TestUtils.java index 87ccb5832d..ee509e0fee 100644 --- a/src/test/java/com/google/api/generator/util/TestUtils.java +++ b/src/test/java/com/google/api/generator/util/TestUtils.java @@ -23,6 +23,7 @@ import com.google.api.generator.engine.ast.VariableExpr; public class TestUtils { + public static ValueExpr generateStringValueExpr(String value) { return ValueExpr.builder().setValue(StringObjectValue.withValue(value)).build(); } From e1a4c49490084a083a86b2ec1f6219c592d45454 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 11:56:06 -0500 Subject: [PATCH 15/40] chore: update showcase maven module to generate and verify golden source --- .../showcase/v1beta1/VerifyTestRequest.java | 873 ++++++++++++++++++ 1 file changed, 873 insertions(+) create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java new file mode 100644 index 0000000000..f2dd6332e6 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java @@ -0,0 +1,873 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} + */ +public final class VerifyTestRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestRequest) + VerifyTestRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use VerifyTestRequest.newBuilder() to construct. + private VerifyTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VerifyTestRequest() { + name_ = ""; + answer_ = com.google.protobuf.ByteString.EMPTY; + answers_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new VerifyTestRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VerifyTestRequest( + 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: { + + answer_ = input.readBytes(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + answers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + answers_.add(input.readBytes()); + 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)) { + answers_ = java.util.Collections.unmodifiableList(answers_); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The test to have an answer registered to it.
+   * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+   * The test to have an answer registered to it.
+   * 
+ * + * string name = 1 [(.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 ANSWER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString answer_; + /** + *
+   * The answer from the test.
+   * 
+ * + * bytes answer = 2; + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + public static final int ANSWERS_FIELD_NUMBER = 3; + private java.util.List answers_; + /** + *
+   * The answers from the test if multiple are to be checked
+   * 
+ * + * repeated bytes answers = 3; + * @return A list containing the answers. + */ + @java.lang.Override + public java.util.List + getAnswersList() { + return answers_; + } + /** + *
+   * The answers from the test if multiple are to be checked
+   * 
+ * + * repeated bytes answers = 3; + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + /** + *
+   * The answers from the test if multiple are to be checked
+   * 
+ * + * repeated bytes answers = 3; + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!answer_.isEmpty()) { + output.writeBytes(2, answer_); + } + for (int i = 0; i < answers_.size(); i++) { + output.writeBytes(3, answers_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!answer_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, answer_); + } + { + int dataSize = 0; + for (int i = 0; i < answers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(answers_.get(i)); + } + size += dataSize; + size += 1 * getAnswersList().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.showcase.v1beta1.VerifyTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestRequest other = (com.google.showcase.v1beta1.VerifyTestRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getAnswer() + .equals(other.getAnswer())) return false; + if (!getAnswersList() + .equals(other.getAnswersList())) 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) + ANSWER_FIELD_NUMBER; + hash = (53 * hash) + getAnswer().hashCode(); + if (getAnswersCount() > 0) { + hash = (37 * hash) + ANSWERS_FIELD_NUMBER; + hash = (53 * hash) + getAnswersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestRequest) + com.google.showcase.v1beta1.VerifyTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestRequest.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_ = ""; + + answer_ = com.google.protobuf.ByteString.EMPTY; + + answers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest build() { + com.google.showcase.v1beta1.VerifyTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest buildPartial() { + com.google.showcase.v1beta1.VerifyTestRequest result = new com.google.showcase.v1beta1.VerifyTestRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.answer_ = answer_; + if (((bitField0_ & 0x00000001) != 0)) { + answers_ = java.util.Collections.unmodifiableList(answers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.answers_ = answers_; + 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.showcase.v1beta1.VerifyTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestRequest other) { + if (other == com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getAnswer() != com.google.protobuf.ByteString.EMPTY) { + setAnswer(other.getAnswer()); + } + if (!other.answers_.isEmpty()) { + if (answers_.isEmpty()) { + answers_ = other.answers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnswersIsMutable(); + answers_.addAll(other.answers_); + } + 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.showcase.v1beta1.VerifyTestRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.VerifyTestRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The test to have an answer registered to it.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The test to have an answer registered to it.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The test to have an answer registered to it.
+     * 
+ * + * string name = 1 [(.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; + } + /** + *
+     * The test to have an answer registered to it.
+     * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The test to have an answer registered to it.
+     * 
+ * + * string name = 1 [(.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 com.google.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The answer from the test.
+     * 
+ * + * bytes answer = 2; + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + /** + *
+     * The answer from the test.
+     * 
+ * + * bytes answer = 2; + * @param value The answer to set. + * @return This builder for chaining. + */ + public Builder setAnswer(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + answer_ = value; + onChanged(); + return this; + } + /** + *
+     * The answer from the test.
+     * 
+ * + * bytes answer = 2; + * @return This builder for chaining. + */ + public Builder clearAnswer() { + + answer_ = getDefaultInstance().getAnswer(); + onChanged(); + return this; + } + + private java.util.List answers_ = java.util.Collections.emptyList(); + private void ensureAnswersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + answers_ = new java.util.ArrayList(answers_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @return A list containing the answers. + */ + public java.util.List + getAnswersList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(answers_) : answers_; + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @param index The index to set the value at. + * @param value The answers to set. + * @return This builder for chaining. + */ + public Builder setAnswers( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @param value The answers to add. + * @return This builder for chaining. + */ + public Builder addAnswers(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.add(value); + onChanged(); + return this; + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @param values The answers to add. + * @return This builder for chaining. + */ + public Builder addAllAnswers( + java.lang.Iterable values) { + ensureAnswersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, answers_); + onChanged(); + return this; + } + /** + *
+     * The answers from the test if multiple are to be checked
+     * 
+ * + * repeated bytes answers = 3; + * @return This builder for chaining. + */ + public Builder clearAnswers() { + answers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + 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.showcase.v1beta1.VerifyTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestRequest) + private static final com.google.showcase.v1beta1.VerifyTestRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestRequest(); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VerifyTestRequest(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.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + From af83acf6c1425bffa3295cff554e8f66d5654cc1 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 11:56:17 -0500 Subject: [PATCH 16/40] chore: update showcase maven module to generate and verify golden source --- pom.xml | 2 + showcase/BUILD.bazel | 57 ++++++++---- showcase/gapic-showcase/pom.xml | 62 +++++++++++++ showcase/grpc-gapic-showcase-v1beta1/pom.xml | 86 +++++++++++++------ showcase/pom.xml | 2 +- showcase/proto-gapic-showcase-v1beta1/pom.xml | 86 +++++++++++++------ showcase/scripts/BUILD.bazel | 5 +- showcase/scripts/update.sh | 13 +-- showcase/scripts/verify.sh | 60 +++++++++++++ 9 files changed, 301 insertions(+), 72 deletions(-) create mode 100755 showcase/scripts/verify.sh diff --git a/pom.xml b/pom.xml index ad31faffd7..f4eb5366c4 100644 --- a/pom.xml +++ b/pom.xml @@ -10,6 +10,8 @@ gapic-generator-java + showcase + coverage diff --git a/showcase/BUILD.bazel b/showcase/BUILD.bazel index 42c82dec8e..83a518aba8 100644 --- a/showcase/BUILD.bazel +++ b/showcase/BUILD.bazel @@ -73,35 +73,62 @@ filegroup( srcs = glob(["proto-gapic-showcase-v1beta1/src/**"]), ) +GAPIC_DATA = [ + "showcase_java_gapic_srcjar_raw.srcjar", + ":gapic_showcase_files", + "//showcase:showcase_java_gapic", +] + sh_binary( name = "update_gapic", srcs = ["//showcase/scripts:update.sh"], args = ["gapic"], - data = [ - "showcase_java_gapic_srcjar_raw.srcjar", - ":gapic_showcase_files", - "//showcase:showcase_java_gapic", - ], + data = GAPIC_DATA, ) +sh_binary( + name = "verify_gapic", + srcs = ["//showcase/scripts:verify.sh"], + args = ["gapic"], + data = GAPIC_DATA, +) + +GRPC_DATA = [ + "libshowcase_java_grpc-src.jar", + ":grpc_gapic_showcase_files", + "//showcase:showcase_java_grpc", +] + sh_binary( name = "update_grpc", srcs = ["//showcase/scripts:update.sh"], args = ["grpc"], - data = [ - "libshowcase_java_grpc-src.jar", - ":grpc_gapic_showcase_files", - "//showcase:showcase_java_grpc", - ], + data = GRPC_DATA, +) + +sh_binary( + name = "verify_grpc", + srcs = ["//showcase/scripts:verify.sh"], + args = ["grpc"], + data = GRPC_DATA, ) +PROTO_DATA = [ + "proto-google-cloud-showcase-v1beta1-java.tar.gz", + ":proto_gapic_showcase_files", + "//showcase:showcase_java_proto", +] + sh_binary( name = "update_proto", srcs = ["//showcase/scripts:update.sh"], args = ["proto"], - data = [ - "proto-google-cloud-showcase-v1beta1-java.tar.gz", - ":proto_gapic_showcase_files", - "//showcase:showcase_java_proto", - ], + data = PROTO_DATA, +) + +sh_binary( + name = "verify_proto", + srcs = ["//showcase/scripts:verify.sh"], + args = ["proto"], + data = PROTO_DATA, ) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 94268a2536..aca12d92f1 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -18,6 +18,68 @@ 0.0.0-SNAPSHOT + + + diff + + true + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + verify-showcase + + exec + + test + + bazel + + run + //showcase:verify_gapic + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + verify-showcase + + exec + + generate-sources + + bazel + + run + //showcase:update_gapic + + + + + + + + + + diff --git a/showcase/grpc-gapic-showcase-v1beta1/pom.xml b/showcase/grpc-gapic-showcase-v1beta1/pom.xml index 8f793f6aeb..bf8c5a49a2 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/pom.xml +++ b/showcase/grpc-gapic-showcase-v1beta1/pom.xml @@ -13,31 +13,67 @@ 0.0.0-SNAPSHOT - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - generate-showcase - - exec - - generate-sources - - bazel - - run - //showcase:update_grpc - - - - - - - + + + diff + + true + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + verify-showcase + + exec + + test + + bazel + + run + //showcase:verify_grpc + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + verify-showcase + + exec + + generate-sources + + bazel + + run + //showcase:update_grpc + + + + + + + + + diff --git a/showcase/pom.xml b/showcase/pom.xml index ebbf95fe22..dfaa5164e2 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -23,7 +23,7 @@ UTF-8 UTF-8 github - google-cloud-iot-parent + google-cloud-showcase-parent diff --git a/showcase/proto-gapic-showcase-v1beta1/pom.xml b/showcase/proto-gapic-showcase-v1beta1/pom.xml index 1ed8bd5d90..1d553364b1 100644 --- a/showcase/proto-gapic-showcase-v1beta1/pom.xml +++ b/showcase/proto-gapic-showcase-v1beta1/pom.xml @@ -13,31 +13,67 @@ 0.0.0-SNAPSHOT - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - generate-showcase - - exec - - generate-sources - - bazel - - run - //showcase:update_proto - - - - - - - + + + diff + + true + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + verify-showcase + + exec + + test + + bazel + + run + //showcase:verify_proto + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + verify-showcase + + exec + + generate-sources + + bazel + + run + //showcase:update_proto + + + + + + + + + diff --git a/showcase/scripts/BUILD.bazel b/showcase/scripts/BUILD.bazel index 33ad1e5f23..504a2a6198 100644 --- a/showcase/scripts/BUILD.bazel +++ b/showcase/scripts/BUILD.bazel @@ -1,3 +1,6 @@ package(default_visibility = ["//showcase:update"]) -exports_files(["update.sh"]) +exports_files([ + "update.sh", + "verify.sh", +]) diff --git a/showcase/scripts/update.sh b/showcase/scripts/update.sh index 0f0c56182d..13a252ff89 100755 --- a/showcase/scripts/update.sh +++ b/showcase/scripts/update.sh @@ -16,6 +16,11 @@ create_unpack_dir() { mkdir "$1" cd "$1" } +delete_unneeded() { + find . -name '.DS_Store' -delete + find . -name 'PlaceholderFile.java' -delete + find . -type d -empty -delete +} case $1 in proto) @@ -26,6 +31,7 @@ case $1 in PROTO_UNPACK_DIR=$PWD tar -xzf "../$PROTO_ARCHIVE" + delete_unneeded cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$PROTO_PROJECT_DIR" mkdir -p ./src cp -r "$PROTO_UNPACK_DIR"/proto-google-cloud-showcase-v1beta1-java/src/* ./src @@ -53,12 +59,9 @@ case $1 in unzip -q -c "../$GAPIC_JAR" temp-codegen.srcjar | jar x cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$GAPIC_PROJECT_DIR" - mkdir -p ./src - cp -r "$GAPIC_UNPACK_DIR"/src/* ./src + cp -r "$GAPIC_UNPACK_DIR"/* ./ ;; esac cd "${BUILD_WORKSPACE_DIRECTORY}/showcase" -find . -name '.DS_Store' -delete -find . -name 'PlaceholderFile.java' -delete -find . -type d -empty -delete +delete_unneeded diff --git a/showcase/scripts/verify.sh b/showcase/scripts/verify.sh new file mode 100755 index 0000000000..22c330d113 --- /dev/null +++ b/showcase/scripts/verify.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# This script is executed by ../BUILD.bazel as a final post-generation step. + +set -o errexit +BAZEL_ROOT=$PWD +SHOWCASE_DIR="$BUILD_WORKSPACE_DIRECTORY/showcase" + +clear_existing() { + cd "$SHOWCASE_DIR/$1" + find . -name '*.java' -not -path '*/it/*' -delete + find . -name 'gapic_metadata.json' -delete + cd - +} +create_unpack_dir() { + cd "$BAZEL_ROOT" + rm -rf "$1" + mkdir "$1" + cd "$1" +} +delete_unneeded() { + find . -name '.DS_Store' -delete + find . -name 'PlaceholderFile.java' -delete + find . -type d -empty -delete +} + +case $1 in + proto) + PROTO_PROJECT_DIR=proto-gapic-showcase-v1beta1 + PROTO_ARCHIVE_NAME=proto-google-cloud-showcase-v1beta1-java + PROTO_ARCHIVE=$(find . -name "$PROTO_ARCHIVE_NAME.tar.gz") + create_unpack_dir proto_unpacked + PROTO_UNPACK_DIR=$PWD + + tar -xzf "../$PROTO_ARCHIVE" + delete_unneeded + diff -ru "$SHOWCASE_DIR/$PROTO_PROJECT_DIR"/src "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src + ;; + + grpc) + GRPC_PROJECT_DIR=grpc-gapic-showcase-v1beta1 + GRPC_JAR=$(find . -name 'libshowcase_java_grpc-src.jar') + create_unpack_dir grpc_unpacked + GRPC_UNPACK_DIR=$PWD + + jar xf "../$GRPC_JAR" + delete_unneeded + diff -ru "$SHOWCASE_DIR/$GRPC_PROJECT_DIR"/src/main/java/com "$GRPC_UNPACK_DIR"/com + ;; + + gapic) + GAPIC_PROJECT_DIR=gapic-showcase + GAPIC_JAR=$(find . -name 'showcase_java_gapic_srcjar_raw.srcjar') + create_unpack_dir gapic_unpacked + GAPIC_UNPACK_DIR=$PWD + + unzip -q -c "../$GAPIC_JAR" temp-codegen.srcjar | jar x + delete_unneeded + diff -ru "$SHOWCASE_DIR/$GAPIC_PROJECT_DIR"/src "$GAPIC_UNPACK_DIR"/src --exclude=it + ;; +esac From 920640ddbbafa72315a5a676ddb6af2cb28db557 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 11:56:46 -0500 Subject: [PATCH 17/40] chore: add showcase golden source to maven submodule --- coverage/pom.xml | 42 + .../google/showcase/v1beta1/BlurbName.java | 473 ++ .../google/showcase/v1beta1/ProfileName.java | 168 + .../com/google/showcase/v1beta1/RoomName.java | 166 + .../google/showcase/v1beta1/SequenceName.java | 168 + .../showcase/v1beta1/SequenceReportName.java | 168 + .../google/showcase/v1beta1/SessionName.java | 168 + .../com/google/showcase/v1beta1/TestName.java | 191 + .../com/google/showcase/v1beta1/UserName.java | 166 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../create/SyncCreateSetEndpoint.java | 41 + .../compliance/getenum/AsyncGetEnum.java | 45 + .../compliance/getenum/SyncGetEnum.java | 42 + .../repeatdatabody/AsyncRepeatDataBody.java | 59 + .../repeatdatabody/SyncRepeatDataBody.java | 55 + .../AsyncRepeatDataBodyInfo.java | 59 + .../SyncRepeatDataBodyInfo.java | 55 + .../AsyncRepeatDataBodyPatch.java | 59 + .../SyncRepeatDataBodyPatch.java | 55 + .../AsyncRepeatDataBodyPut.java | 59 + .../SyncRepeatDataBodyPut.java | 55 + .../AsyncRepeatDataPathResource.java | 59 + .../SyncRepeatDataPathResource.java | 55 + .../AsyncRepeatDataPathTrailingResource.java | 59 + .../SyncRepeatDataPathTrailingResource.java | 55 + .../repeatdataquery/AsyncRepeatDataQuery.java | 59 + .../repeatdataquery/SyncRepeatDataQuery.java | 55 + .../AsyncRepeatDataSimplePath.java | 59 + .../SyncRepeatDataSimplePath.java | 55 + .../verifyenum/AsyncVerifyEnum.java | 50 + .../compliance/verifyenum/SyncVerifyEnum.java | 47 + .../repeatdatabody/SyncRepeatDataBody.java | 48 + .../v1beta1/echo/block/AsyncBlock.java | 47 + .../v1beta1/echo/block/SyncBlock.java | 44 + .../showcase/v1beta1/echo/chat/AsyncChat.java | 53 + .../v1beta1/echo/collect/AsyncCollect.java | 68 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../echo/create/SyncCreateSetEndpoint.java | 40 + .../showcase/v1beta1/echo/echo/AsyncEcho.java | 51 + .../showcase/v1beta1/echo/echo/SyncEcho.java | 48 + .../v1beta1/echo/expand/AsyncExpand.java | 51 + .../echo/pagedexpand/AsyncPagedExpand.java | 52 + .../pagedexpand/AsyncPagedExpandPaged.java | 60 + .../echo/pagedexpand/SyncPagedExpand.java | 49 + .../AsyncPagedExpandLegacy.java | 51 + .../SyncPagedExpandLegacy.java | 47 + .../AsyncPagedExpandLegacyMapped.java | 54 + .../AsyncPagedExpandLegacyMappedPaged.java | 62 + .../SyncPagedExpandLegacyMapped.java | 51 + .../showcase/v1beta1/echo/wait/AsyncWait.java | 45 + .../v1beta1/echo/wait/AsyncWaitLRO.java | 47 + .../showcase/v1beta1/echo/wait/SyncWait.java | 42 + .../v1beta1/echosettings/echo/SyncEcho.java | 48 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../create/SyncCreateSetEndpoint.java | 41 + .../identity/createuser/AsyncCreateUser.java | 46 + .../identity/createuser/SyncCreateUser.java | 43 + .../SyncCreateUserStringString.java | 42 + ...serStringStringIntStringBooleanDouble.java | 48 + .../identity/deleteuser/AsyncDeleteUser.java | 47 + .../identity/deleteuser/SyncDeleteUser.java | 44 + .../deleteuser/SyncDeleteUserString.java | 42 + .../deleteuser/SyncDeleteUserUsername.java | 42 + .../identity/getuser/AsyncGetUser.java | 47 + .../v1beta1/identity/getuser/SyncGetUser.java | 44 + .../identity/getuser/SyncGetUserString.java | 42 + .../identity/getuser/SyncGetUserUsername.java | 42 + .../identity/listusers/AsyncListUsers.java | 51 + .../listusers/AsyncListUsersPaged.java | 59 + .../identity/listusers/SyncListUsers.java | 48 + .../identity/updateuser/AsyncUpdateUser.java | 50 + .../identity/updateuser/SyncUpdateUser.java | 47 + .../createuser/SyncCreateUser.java | 48 + .../messaging/connect/AsyncConnect.java | 48 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../create/SyncCreateSetEndpoint.java | 41 + .../createblurb/AsyncCreateBlurb.java | 50 + .../createblurb/SyncCreateBlurb.java | 47 + ...reateBlurbProfilenameStringBytestring.java | 46 + ...yncCreateBlurbProfilenameStringString.java | 45 + ...ateBlurbProfilenameUsernameBytestring.java | 46 + ...cCreateBlurbProfilenameUsernameString.java | 45 + ...ncCreateBlurbRoomnameStringBytestring.java | 46 + .../SyncCreateBlurbRoomnameStringString.java | 45 + ...CreateBlurbRoomnameUsernameBytestring.java | 46 + ...SyncCreateBlurbRoomnameUsernameString.java | 45 + ...SyncCreateBlurbStringStringBytestring.java | 46 + .../SyncCreateBlurbStringStringString.java | 45 + ...ncCreateBlurbStringUsernameBytestring.java | 46 + .../SyncCreateBlurbStringUsernameString.java | 45 + .../messaging/createroom/AsyncCreateRoom.java | 46 + .../messaging/createroom/SyncCreateRoom.java | 43 + .../SyncCreateRoomStringString.java | 42 + .../deleteblurb/AsyncDeleteBlurb.java | 49 + .../deleteblurb/SyncDeleteBlurb.java | 46 + .../deleteblurb/SyncDeleteBlurbBlurbname.java | 42 + .../deleteblurb/SyncDeleteBlurbString.java | 43 + .../messaging/deleteroom/AsyncDeleteRoom.java | 47 + .../messaging/deleteroom/SyncDeleteRoom.java | 44 + .../deleteroom/SyncDeleteRoomRoomname.java | 42 + .../deleteroom/SyncDeleteRoomString.java | 42 + .../messaging/getblurb/AsyncGetBlurb.java | 49 + .../messaging/getblurb/SyncGetBlurb.java | 46 + .../getblurb/SyncGetBlurbBlurbname.java | 42 + .../getblurb/SyncGetBlurbString.java | 43 + .../messaging/getroom/AsyncGetRoom.java | 47 + .../messaging/getroom/SyncGetRoom.java | 44 + .../getroom/SyncGetRoomRoomname.java | 42 + .../messaging/getroom/SyncGetRoomString.java | 42 + .../messaging/listblurbs/AsyncListBlurbs.java | 53 + .../listblurbs/AsyncListBlurbsPaged.java | 61 + .../messaging/listblurbs/SyncListBlurbs.java | 50 + .../listblurbs/SyncListBlurbsProfilename.java | 44 + .../listblurbs/SyncListBlurbsRoomname.java | 44 + .../listblurbs/SyncListBlurbsString.java | 44 + .../messaging/listrooms/AsyncListRooms.java | 51 + .../listrooms/AsyncListRoomsPaged.java | 59 + .../messaging/listrooms/SyncListRooms.java | 48 + .../searchblurbs/AsyncSearchBlurbs.java | 52 + .../searchblurbs/AsyncSearchBlurbsLRO.java | 54 + .../searchblurbs/SyncSearchBlurbs.java | 49 + .../SyncSearchBlurbsProfilenameString.java | 43 + .../SyncSearchBlurbsRoomnameString.java | 43 + .../SyncSearchBlurbsStringString.java | 43 + .../messaging/sendblurbs/AsyncSendBlurbs.java | 68 + .../streamblurbs/AsyncStreamBlurbs.java | 53 + .../updateblurb/AsyncUpdateBlurb.java | 50 + .../updateblurb/SyncUpdateBlurb.java | 47 + .../messaging/updateroom/AsyncUpdateRoom.java | 50 + .../messaging/updateroom/SyncUpdateRoom.java | 47 + .../createroom/SyncCreateRoom.java | 48 + .../attemptsequence/AsyncAttemptSequence.java | 49 + .../attemptsequence/SyncAttemptSequence.java | 46 + .../SyncAttemptSequenceSequencename.java | 42 + .../SyncAttemptSequenceString.java | 42 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../createsequence/AsyncCreateSequence.java | 47 + .../createsequence/SyncCreateSequence.java | 43 + .../SyncCreateSequenceSequence.java | 41 + .../AsyncGetSequenceReport.java | 50 + .../SyncGetSequenceReport.java | 46 + ...ncGetSequenceReportSequencereportname.java | 42 + .../SyncGetSequenceReportString.java | 42 + .../createsequence/SyncCreateSequence.java | 49 + .../repeatdatabody/SyncRepeatDataBody.java | 48 + .../stub/echostubsettings/echo/SyncEcho.java | 48 + .../createuser/SyncCreateUser.java | 48 + .../createroom/SyncCreateRoom.java | 48 + .../createsequence/SyncCreateSequence.java | 49 + .../createsession/SyncCreateSession.java | 48 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../testing/create/SyncCreateSetEndpoint.java | 40 + .../createsession/AsyncCreateSession.java | 46 + .../createsession/SyncCreateSession.java | 43 + .../deletesession/AsyncDeleteSession.java | 47 + .../deletesession/SyncDeleteSession.java | 44 + .../testing/deletetest/AsyncDeleteTest.java | 49 + .../testing/deletetest/SyncDeleteTest.java | 46 + .../testing/getsession/AsyncGetSession.java | 47 + .../testing/getsession/SyncGetSession.java | 44 + .../listsessions/AsyncListSessions.java | 51 + .../listsessions/AsyncListSessionsPaged.java | 59 + .../listsessions/SyncListSessions.java | 48 + .../testing/listtests/AsyncListTests.java | 53 + .../listtests/AsyncListTestsPaged.java | 61 + .../testing/listtests/SyncListTests.java | 50 + .../reportsession/AsyncReportSession.java | 48 + .../reportsession/SyncReportSession.java | 44 + .../testing/verifytest/AsyncVerifyTest.java | 53 + .../testing/verifytest/SyncVerifyTest.java | 50 + .../createsession/SyncCreateSession.java | 48 + .../v1beta1/AttemptSequenceRequest.java | 559 +++ .../AttemptSequenceRequestOrBuilder.java | 21 + .../google/showcase/v1beta1/BlockRequest.java | 1272 ++++++ .../v1beta1/BlockRequestOrBuilder.java | 95 + .../showcase/v1beta1/BlockResponse.java | 602 +++ .../v1beta1/BlockResponseOrBuilder.java | 31 + .../com/google/showcase/v1beta1/Blurb.java | 2177 ++++++++++ .../google/showcase/v1beta1/BlurbName.java | 473 ++ .../showcase/v1beta1/BlurbOrBuilder.java | 225 + .../showcase/v1beta1/ComplianceData.java | 2662 ++++++++++++ .../showcase/v1beta1/ComplianceDataChild.java | 1766 ++++++++ .../v1beta1/ComplianceDataChildOrBuilder.java | 141 + .../v1beta1/ComplianceDataGrandchild.java | 690 +++ .../ComplianceDataGrandchildOrBuilder.java | 33 + .../v1beta1/ComplianceDataOrBuilder.java | 212 + .../showcase/v1beta1/ComplianceGroup.java | 1114 +++++ .../v1beta1/ComplianceGroupOrBuilder.java | 70 + .../v1beta1/ComplianceOuterClass.java | 252 ++ .../showcase/v1beta1/ComplianceSuite.java | 784 ++++ .../v1beta1/ComplianceSuiteOrBuilder.java | 33 + .../showcase/v1beta1/ConnectRequest.java | 1644 +++++++ .../v1beta1/ConnectRequestOrBuilder.java | 68 + .../google/showcase/v1beta1/Continent.java | 149 + .../showcase/v1beta1/CreateBlurbRequest.java | 840 ++++ .../v1beta1/CreateBlurbRequestOrBuilder.java | 58 + .../showcase/v1beta1/CreateRoomRequest.java | 667 +++ .../v1beta1/CreateRoomRequestOrBuilder.java | 36 + .../v1beta1/CreateSequenceRequest.java | 609 +++ .../CreateSequenceRequestOrBuilder.java | 24 + .../v1beta1/CreateSessionRequest.java | 689 +++ .../CreateSessionRequestOrBuilder.java | 42 + .../showcase/v1beta1/CreateUserRequest.java | 667 +++ .../v1beta1/CreateUserRequestOrBuilder.java | 36 + .../showcase/v1beta1/DeleteBlurbRequest.java | 597 +++ .../v1beta1/DeleteBlurbRequestOrBuilder.java | 29 + .../showcase/v1beta1/DeleteRoomRequest.java | 597 +++ .../v1beta1/DeleteRoomRequestOrBuilder.java | 29 + .../v1beta1/DeleteSessionRequest.java | 595 +++ .../DeleteSessionRequestOrBuilder.java | 29 + .../showcase/v1beta1/DeleteTestRequest.java | 595 +++ .../v1beta1/DeleteTestRequestOrBuilder.java | 29 + .../showcase/v1beta1/DeleteUserRequest.java | 597 +++ .../v1beta1/DeleteUserRequestOrBuilder.java | 29 + .../showcase/v1beta1/EchoOuterClass.java | 301 ++ .../google/showcase/v1beta1/EchoRequest.java | 1439 ++++++ .../v1beta1/EchoRequestOrBuilder.java | 126 + .../google/showcase/v1beta1/EchoResponse.java | 719 +++ .../v1beta1/EchoResponseOrBuilder.java | 48 + .../google/showcase/v1beta1/EnumRequest.java | 502 +++ .../v1beta1/EnumRequestOrBuilder.java | 19 + .../google/showcase/v1beta1/EnumResponse.java | 781 ++++ .../v1beta1/EnumResponseOrBuilder.java | 55 + .../showcase/v1beta1/ExpandRequest.java | 831 ++++ .../v1beta1/ExpandRequestOrBuilder.java | 56 + .../showcase/v1beta1/GetBlurbRequest.java | 597 +++ .../v1beta1/GetBlurbRequestOrBuilder.java | 29 + .../showcase/v1beta1/GetRoomRequest.java | 597 +++ .../v1beta1/GetRoomRequestOrBuilder.java | 29 + .../v1beta1/GetSequenceReportRequest.java | 559 +++ .../GetSequenceReportRequestOrBuilder.java | 21 + .../showcase/v1beta1/GetSessionRequest.java | 595 +++ .../v1beta1/GetSessionRequestOrBuilder.java | 29 + .../showcase/v1beta1/GetUserRequest.java | 597 +++ .../v1beta1/GetUserRequestOrBuilder.java | 29 + .../showcase/v1beta1/IdentityOuterClass.java | 187 + .../com/google/showcase/v1beta1/Issue.java | 1136 +++++ .../showcase/v1beta1/IssueOrBuilder.java | 67 + .../showcase/v1beta1/ListBlurbsRequest.java | 865 ++++ .../v1beta1/ListBlurbsRequestOrBuilder.java | 65 + .../showcase/v1beta1/ListBlurbsResponse.java | 1061 +++++ .../v1beta1/ListBlurbsResponseOrBuilder.java | 79 + .../showcase/v1beta1/ListRoomsRequest.java | 695 +++ .../v1beta1/ListRoomsRequestOrBuilder.java | 44 + .../showcase/v1beta1/ListRoomsResponse.java | 1061 +++++ .../v1beta1/ListRoomsResponseOrBuilder.java | 79 + .../showcase/v1beta1/ListSessionsRequest.java | 675 +++ .../v1beta1/ListSessionsRequestOrBuilder.java | 39 + .../v1beta1/ListSessionsResponse.java | 1045 +++++ .../ListSessionsResponseOrBuilder.java | 75 + .../showcase/v1beta1/ListTestsRequest.java | 841 ++++ .../v1beta1/ListTestsRequestOrBuilder.java | 59 + .../showcase/v1beta1/ListTestsResponse.java | 1045 +++++ .../v1beta1/ListTestsResponseOrBuilder.java | 75 + .../showcase/v1beta1/ListUsersRequest.java | 695 +++ .../v1beta1/ListUsersRequestOrBuilder.java | 44 + .../showcase/v1beta1/ListUsersResponse.java | 1061 +++++ .../v1beta1/ListUsersResponseOrBuilder.java | 79 + .../showcase/v1beta1/MessagingOuterClass.java | 447 ++ .../PagedExpandLegacyMappedResponse.java | 942 ++++ ...edExpandLegacyMappedResponseOrBuilder.java | 95 + .../v1beta1/PagedExpandLegacyRequest.java | 853 ++++ .../PagedExpandLegacyRequestOrBuilder.java | 61 + .../showcase/v1beta1/PagedExpandRequest.java | 841 ++++ .../v1beta1/PagedExpandRequestOrBuilder.java | 59 + .../showcase/v1beta1/PagedExpandResponse.java | 1038 +++++ .../v1beta1/PagedExpandResponseList.java | 624 +++ .../PagedExpandResponseListOrBuilder.java | 34 + .../v1beta1/PagedExpandResponseOrBuilder.java | 73 + .../google/showcase/v1beta1/ProfileName.java | 168 + .../showcase/v1beta1/RepeatRequest.java | 1518 +++++++ .../v1beta1/RepeatRequestOrBuilder.java | 132 + .../showcase/v1beta1/RepeatResponse.java | 775 ++++ .../v1beta1/RepeatResponseOrBuilder.java | 44 + .../v1beta1/ReportSessionRequest.java | 595 +++ .../ReportSessionRequestOrBuilder.java | 29 + .../v1beta1/ReportSessionResponse.java | 1150 +++++ .../ReportSessionResponseOrBuilder.java | 72 + .../com/google/showcase/v1beta1/Room.java | 1399 ++++++ .../com/google/showcase/v1beta1/RoomName.java | 166 + .../showcase/v1beta1/RoomOrBuilder.java | 123 + .../v1beta1/SearchBlurbsMetadata.java | 667 +++ .../SearchBlurbsMetadataOrBuilder.java | 36 + .../showcase/v1beta1/SearchBlurbsRequest.java | 1052 +++++ .../v1beta1/SearchBlurbsRequestOrBuilder.java | 91 + .../v1beta1/SearchBlurbsResponse.java | 1061 +++++ .../SearchBlurbsResponseOrBuilder.java | 79 + .../showcase/v1beta1/SendBlurbsResponse.java | 678 +++ .../v1beta1/SendBlurbsResponseOrBuilder.java | 50 + .../com/google/showcase/v1beta1/Sequence.java | 1979 +++++++++ .../google/showcase/v1beta1/SequenceName.java | 168 + .../showcase/v1beta1/SequenceOrBuilder.java | 70 + .../showcase/v1beta1/SequenceOuterClass.java | 184 + .../showcase/v1beta1/SequenceReport.java | 2602 +++++++++++ .../showcase/v1beta1/SequenceReportName.java | 168 + .../v1beta1/SequenceReportOrBuilder.java | 65 + .../com/google/showcase/v1beta1/Session.java | 879 ++++ .../google/showcase/v1beta1/SessionName.java | 168 + .../showcase/v1beta1/SessionOrBuilder.java | 50 + .../com/google/showcase/v1beta1/Severity.java | 135 + .../showcase/v1beta1/StreamBlurbsRequest.java | 833 ++++ .../v1beta1/StreamBlurbsRequestOrBuilder.java | 56 + .../v1beta1/StreamBlurbsResponse.java | 945 ++++ .../StreamBlurbsResponseOrBuilder.java | 55 + .../com/google/showcase/v1beta1/Test.java | 3839 +++++++++++++++++ .../com/google/showcase/v1beta1/TestName.java | 191 + .../showcase/v1beta1/TestOrBuilder.java | 131 + .../com/google/showcase/v1beta1/TestRun.java | 845 ++++ .../showcase/v1beta1/TestRunOrBuilder.java | 60 + .../showcase/v1beta1/TestingOuterClass.java | 345 ++ .../showcase/v1beta1/UpdateBlurbRequest.java | 915 ++++ .../v1beta1/UpdateBlurbRequestOrBuilder.java | 66 + .../showcase/v1beta1/UpdateRoomRequest.java | 915 ++++ .../v1beta1/UpdateRoomRequestOrBuilder.java | 66 + .../showcase/v1beta1/UpdateUserRequest.java | 915 ++++ .../v1beta1/UpdateUserRequestOrBuilder.java | 66 + .../com/google/showcase/v1beta1/User.java | 1972 +++++++++ .../com/google/showcase/v1beta1/UserName.java | 166 + .../showcase/v1beta1/UserOrBuilder.java | 219 + .../v1beta1/VerifyTestRequestOrBuilder.java | 68 + .../showcase/v1beta1/VerifyTestResponse.java | 657 +++ .../v1beta1/VerifyTestResponseOrBuilder.java | 36 + .../google/showcase/v1beta1/WaitMetadata.java | 665 +++ .../v1beta1/WaitMetadataOrBuilder.java | 36 + .../google/showcase/v1beta1/WaitRequest.java | 1631 +++++++ .../v1beta1/WaitRequestOrBuilder.java | 124 + .../google/showcase/v1beta1/WaitResponse.java | 595 +++ .../v1beta1/WaitResponseOrBuilder.java | 29 + 335 files changed, 88553 insertions(+) create mode 100644 coverage/pom.xml create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java create mode 100644 showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java create mode 100644 showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java create mode 100644 showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java diff --git a/coverage/pom.xml b/coverage/pom.xml new file mode 100644 index 0000000000..870c156561 --- /dev/null +++ b/coverage/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + com.google.api + gapic-generator-java-coverage-aggregate + 0.0.1-SNAPSHOT + pom + Aggregate Report + + + + com.google.api + gapic-generator-java + 0.0.1-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.0-SNAPSHOT + + + + + + + org.jacoco + jacoco-maven-plugin + + + report-aggregate + verify + + report-aggregate + + + + + + + \ No newline at end of file diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java new file mode 100644 index 0000000000..32f3ed2380 --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -0,0 +1,473 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 BlurbName implements ResourceName { + private static final PathTemplate USER_LEGACY_USER_BLURB = + PathTemplate.createWithoutUrlEncoding( + "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + private static final PathTemplate USER_BLURB = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); + private static final PathTemplate ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); + private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String user; + private final String legacyUser; + private final String blurb; + private final String room; + private final String legacyRoom; + + @Deprecated + protected BlurbName() { + user = null; + legacyUser = null; + blurb = null; + room = null; + legacyRoom = null; + } + + private BlurbName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + room = null; + legacyRoom = null; + pathTemplate = USER_LEGACY_USER_BLURB; + } + + private BlurbName(UserBlurbBuilder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + legacyUser = null; + room = null; + legacyRoom = null; + pathTemplate = USER_BLURB; + } + + private BlurbName(RoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + legacyRoom = null; + pathTemplate = ROOM_BLURB; + } + + private BlurbName(RoomLegacyRoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + pathTemplate = ROOM_LEGACY_ROOM_BLURB; + } + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newUserLegacyUserBlurbBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static UserBlurbBuilder newUserBlurbBuilder() { + return new UserBlurbBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static RoomBlurbBuilder newRoomBlurbBuilder() { + return new RoomBlurbBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { + return new RoomLegacyRoomBlurbBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BlurbName of(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build(); + } + + public static String format(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build() + .toString(); + } + + public static BlurbName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (USER_LEGACY_USER_BLURB.matches(formattedString)) { + Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); + return ofUserLegacyUserBlurbName( + matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); + } else if (USER_BLURB.matches(formattedString)) { + Map matchMap = USER_BLURB.match(formattedString); + return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); + } else if (ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_BLURB.match(formattedString); + return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); + } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); + return ofRoomLegacyRoomBlurbName( + matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); + } + throw new ValidationException("BlurbName.parse: formattedString not in valid format"); + } + + 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 (BlurbName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_LEGACY_USER_BLURB.matches(formattedString) + || USER_BLURB.matches(formattedString) + || ROOM_BLURB.matches(formattedString) + || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (legacyUser != null) { + fieldMapBuilder.put("legacy_user", legacyUser); + } + if (blurb != null) { + fieldMapBuilder.put("blurb", blurb); + } + if (room != null) { + fieldMapBuilder.put("room", room); + } + if (legacyRoom != null) { + fieldMapBuilder.put("legacy_room", legacyRoom); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BlurbName that = ((BlurbName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.legacyUser, that.legacyUser) + && Objects.equals(this.blurb, that.blurb) + && Objects.equals(this.room, that.room) + && Objects.equals(this.legacyRoom, that.legacyRoom); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(legacyUser); + h *= 1000003; + h ^= Objects.hashCode(blurb); + h *= 1000003; + h ^= Objects.hashCode(room); + h *= 1000003; + h ^= Objects.hashCode(legacyRoom); + return h; + } + + /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ + public static class Builder { + private String user; + private String legacyUser; + private String blurb; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setLegacyUser(String legacyUser) { + this.legacyUser = legacyUser; + return this; + } + + public Builder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + private Builder(BlurbName blurbName) { + Preconditions.checkArgument( + Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), + "toBuilder is only supported when BlurbName has the pattern of users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + this.user = blurbName.user; + this.legacyUser = blurbName.legacyUser; + this.blurb = blurbName.blurb; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for users/{user}/profile/blurbs/{blurb}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class UserBlurbBuilder { + private String user; + private String blurb; + + protected UserBlurbBuilder() {} + + public String getUser() { + return user; + } + + public String getBlurb() { + return blurb; + } + + public UserBlurbBuilder setUser(String user) { + this.user = user; + return this; + } + + public UserBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/{blurb}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class RoomBlurbBuilder { + private String room; + private String blurb; + + protected RoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getBlurb() { + return blurb; + } + + public RoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class RoomLegacyRoomBlurbBuilder { + private String room; + private String legacyRoom; + private String blurb; + + protected RoomLegacyRoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public String getBlurb() { + return blurb; + } + + public RoomLegacyRoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { + this.legacyRoom = legacyRoom; + return this; + } + + public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java new file mode 100644 index 0000000000..b69500d0ae --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 ProfileName implements ResourceName { + private static final PathTemplate USER = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected ProfileName() { + user = null; + } + + private ProfileName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProfileName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static ProfileName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch( + formattedString, "ProfileName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (ProfileName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProfileName that = ((ProfileName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}/profile/blurbs. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(ProfileName profileName) { + this.user = profileName.user; + } + + public ProfileName build() { + return new ProfileName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java new file mode 100644 index 0000000000..b7ebbbad5d --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -0,0 +1,166 @@ +/* + * 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.showcase.v1beta1; + +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 RoomName implements ResourceName { + private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); + private volatile Map fieldValuesMap; + private final String room; + + @Deprecated + protected RoomName() { + room = null; + } + + private RoomName(Builder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + } + + public String getRoom() { + return room; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RoomName of(String room) { + return newBuilder().setRoom(room).build(); + } + + public static String format(String room) { + return newBuilder().setRoom(room).build().toString(); + } + + public static RoomName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); + return of(matchMap.get("room")); + } + + 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 (RoomName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ROOM.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (room != null) { + fieldMapBuilder.put("room", room); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ROOM.instantiate("room", room); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + RoomName that = ((RoomName) o); + return Objects.equals(this.room, that.room); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(room); + return h; + } + + /** Builder for rooms/{room}. */ + public static class Builder { + private String room; + + protected Builder() {} + + public String getRoom() { + return room; + } + + public Builder setRoom(String room) { + this.room = room; + return this; + } + + private Builder(RoomName roomName) { + this.room = roomName.room; + } + + public RoomName build() { + return new RoomName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java new file mode 100644 index 0000000000..067bb15adb --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 SequenceName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceName() { + sequence = null; + } + + private SequenceName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SequenceName that = ((SequenceName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceName sequenceName) { + this.sequence = sequenceName.sequence; + } + + public SequenceName build() { + return new SequenceName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java new file mode 100644 index 0000000000..80742478a3 --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 SequenceReportName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceReportName() { + sequence = null; + } + + private SequenceReportName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceReportName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SequenceReportName that = ((SequenceReportName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}/sequenceReport. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceReportName sequenceReportName) { + this.sequence = sequenceReportName.sequence; + } + + public SequenceReportName build() { + return new SequenceReportName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java new file mode 100644 index 0000000000..a205c1272d --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 SessionName implements ResourceName { + private static final PathTemplate SESSION = + PathTemplate.createWithoutUrlEncoding("sessions/{session}"); + private volatile Map fieldValuesMap; + private final String session; + + @Deprecated + protected SessionName() { + session = null; + } + + private SessionName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + } + + public String getSession() { + return session; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of(String session) { + return newBuilder().setSession(session).build(); + } + + public static String format(String session) { + return newBuilder().setSession(session).build().toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION.validatedMatch( + formattedString, "SessionName.parse: formattedString not in valid format"); + return of(matchMap.get("session")); + } + + 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 (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION.instantiate("session", session); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.session, that.session); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + return h; + } + + /** Builder for sessions/{session}. */ + public static class Builder { + private String session; + + protected Builder() {} + + public String getSession() { + return session; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + this.session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java new file mode 100644 index 0000000000..fb2855113a --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java @@ -0,0 +1,191 @@ +/* + * 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.showcase.v1beta1; + +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 TestName implements ResourceName { + private static final PathTemplate SESSION_TEST = + PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); + private volatile Map fieldValuesMap; + private final String session; + private final String test; + + @Deprecated + protected TestName() { + session = null; + test = null; + } + + private TestName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + test = Preconditions.checkNotNull(builder.getTest()); + } + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TestName of(String session, String test) { + return newBuilder().setSession(session).setTest(test).build(); + } + + public static String format(String session, String test) { + return newBuilder().setSession(session).setTest(test).build().toString(); + } + + public static TestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION_TEST.validatedMatch( + formattedString, "TestName.parse: formattedString not in valid format"); + return of(matchMap.get("session"), matchMap.get("test")); + } + + 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 (TestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION_TEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (test != null) { + fieldMapBuilder.put("test", test); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION_TEST.instantiate("session", session, "test", test); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TestName that = ((TestName) o); + return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(test); + return h; + } + + /** Builder for sessions/{session}/tests/{test}. */ + public static class Builder { + private String session; + private String test; + + protected Builder() {} + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + public Builder setTest(String test) { + this.test = test; + return this; + } + + private Builder(TestName testName) { + this.session = testName.session; + this.test = testName.test; + } + + public TestName build() { + return new TestName(this); + } + } +} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java new file mode 100644 index 0000000000..df5a3618b7 --- /dev/null +++ b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -0,0 +1,166 @@ +/* + * 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.showcase.v1beta1; + +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 UserName implements ResourceName { + private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected UserName() { + user = null; + } + + private UserName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..46846134bb --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ComplianceSettings complianceSettings = + ComplianceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + } +} +// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000000..f28602378a --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider1_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build(); + ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + } +} +// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..40b937f7f3 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ComplianceSettings complianceSettings = + ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + } +} +// [END localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java new file mode 100644 index 0000000000..464c666e72 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_GetEnum_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; + +public class AsyncGetEnum { + + public static void main(String[] args) throws Exception { + asyncGetEnum(); + } + + public static void asyncGetEnum() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + ApiFuture future = complianceClient.getEnumCallable().futureCall(request); + // Do something. + EnumResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_GetEnum_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java new file mode 100644 index 0000000000..25e134f2a3 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_GetEnum_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; + +public class SyncGetEnum { + + public static void main(String[] args) throws Exception { + syncGetEnum(); + } + + public static void syncGetEnum() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + EnumResponse response = complianceClient.getEnum(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_GetEnum_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java new file mode 100644 index 0000000000..02379d2e01 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBody_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + asyncRepeatDataBody(); + } + + public static void asyncRepeatDataBody() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataBodyCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBody_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java new file mode 100644 index 0000000000..9769ea47da --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + syncRepeatDataBody(); + } + + public static void syncRepeatDataBody() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataBody(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java new file mode 100644 index 0000000000..80138be72f --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataBodyInfo { + + public static void main(String[] args) throws Exception { + asyncRepeatDataBodyInfo(); + } + + public static void asyncRepeatDataBodyInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataBodyInfoCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java new file mode 100644 index 0000000000..c3b00bd27e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataBodyInfo { + + public static void main(String[] args) throws Exception { + syncRepeatDataBodyInfo(); + } + + public static void syncRepeatDataBodyInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataBodyInfo(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java new file mode 100644 index 0000000000..d62dcd97b9 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataBodyPatch { + + public static void main(String[] args) throws Exception { + asyncRepeatDataBodyPatch(); + } + + public static void asyncRepeatDataBodyPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataBodyPatchCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java new file mode 100644 index 0000000000..1e53216e8d --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataBodyPatch { + + public static void main(String[] args) throws Exception { + syncRepeatDataBodyPatch(); + } + + public static void syncRepeatDataBodyPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataBodyPatch(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java new file mode 100644 index 0000000000..61fb607032 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataBodyPut { + + public static void main(String[] args) throws Exception { + asyncRepeatDataBodyPut(); + } + + public static void asyncRepeatDataBodyPut() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataBodyPutCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java new file mode 100644 index 0000000000..4f4d65a084 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataBodyPut { + + public static void main(String[] args) throws Exception { + syncRepeatDataBodyPut(); + } + + public static void syncRepeatDataBodyPut() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataBodyPut(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java new file mode 100644 index 0000000000..020978c742 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataPathResource { + + public static void main(String[] args) throws Exception { + asyncRepeatDataPathResource(); + } + + public static void asyncRepeatDataPathResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataPathResourceCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java new file mode 100644 index 0000000000..3a0e60981f --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataPathResource { + + public static void main(String[] args) throws Exception { + syncRepeatDataPathResource(); + } + + public static void syncRepeatDataPathResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataPathResource(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java new file mode 100644 index 0000000000..1c3b305371 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataPathTrailingResource { + + public static void main(String[] args) throws Exception { + asyncRepeatDataPathTrailingResource(); + } + + public static void asyncRepeatDataPathTrailingResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java new file mode 100644 index 0000000000..73883a1773 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataPathTrailingResource { + + public static void main(String[] args) throws Exception { + syncRepeatDataPathTrailingResource(); + } + + public static void syncRepeatDataPathTrailingResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataPathTrailingResource(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java new file mode 100644 index 0000000000..c174e28a01 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataQuery { + + public static void main(String[] args) throws Exception { + asyncRepeatDataQuery(); + } + + public static void asyncRepeatDataQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataQueryCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java new file mode 100644 index 0000000000..2f4dd67b42 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataQuery { + + public static void main(String[] args) throws Exception { + syncRepeatDataQuery(); + } + + public static void syncRepeatDataQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataQuery(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java new file mode 100644 index 0000000000..ff20f79853 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataSimplePath { + + public static void main(String[] args) throws Exception { + asyncRepeatDataSimplePath(); + } + + public static void asyncRepeatDataSimplePath() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + ApiFuture future = + complianceClient.repeatDataSimplePathCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java new file mode 100644 index 0000000000..4cec930750 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataSimplePath { + + public static void main(String[] args) throws Exception { + syncRepeatDataSimplePath(); + } + + public static void syncRepeatDataSimplePath() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataSimplePath(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java new file mode 100644 index 0000000000..ceae5e5edc --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_VerifyEnum_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.Continent; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; + +public class AsyncVerifyEnum { + + public static void main(String[] args) throws Exception { + asyncVerifyEnum(); + } + + public static void asyncVerifyEnum() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request); + // Do something. + EnumResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_VerifyEnum_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java new file mode 100644 index 0000000000..cf742f475d --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_VerifyEnum_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.Continent; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; + +public class SyncVerifyEnum { + + public static void main(String[] args) throws Exception { + syncVerifyEnum(); + } + + public static void syncVerifyEnum() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + EnumResponse response = complianceClient.verifyEnum(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_VerifyEnum_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java new file mode 100644 index 0000000000..50c6680f41 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] +import com.google.showcase.v1beta1.ComplianceSettings; +import java.time.Duration; + +public class SyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + syncRepeatDataBody(); + } + + public static void syncRepeatDataBody() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder(); + complianceSettingsBuilder + .repeatDataBodySettings() + .setRetrySettings( + complianceSettingsBuilder + .repeatDataBodySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java new file mode 100644 index 0000000000..5d1e13ec6b --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Block_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Duration; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; + +public class AsyncBlock { + + public static void main(String[] args) throws Exception { + asyncBlock(); + } + + public static void asyncBlock() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + ApiFuture future = echoClient.blockCallable().futureCall(request); + // Do something. + BlockResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Block_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java new file mode 100644 index 0000000000..33e753f91c --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Block_sync] +import com.google.protobuf.Duration; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; + +public class SyncBlock { + + public static void main(String[] args) throws Exception { + syncBlock(); + } + + public static void syncBlock() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + BlockResponse response = echoClient.block(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Block_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java new file mode 100644 index 0000000000..fc7ae4a2fd --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java @@ -0,0 +1,53 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Chat_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.Severity; + +public class AsyncChat { + + public static void main(String[] args) throws Exception { + asyncChat(); + } + + public static void asyncChat() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + BidiStream bidiStream = echoClient.chatCallable().call(); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + bidiStream.send(request); + for (EchoResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Chat_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java new file mode 100644 index 0000000000..faace6e726 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java @@ -0,0 +1,68 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Collect_async] +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.Severity; + +public class AsyncCollect { + + public static void main(String[] args) throws Exception { + asyncCollect(); + } + + public static void asyncCollect() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + ApiStreamObserver responseObserver = + new ApiStreamObserver() { + @Override + public void onNext(EchoResponse response) { + // Do something when a response is received. + } + + @Override + public void onError(Throwable t) { + // Add error-handling + } + + @Override + public void onCompleted() { + // Do something when complete. + } + }; + ApiStreamObserver requestObserver = + echoClient.collect().clientStreamingCall(responseObserver); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + requestObserver.onNext(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Collect_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..a9ebbf7ae9 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoSettings echoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + EchoClient echoClient = EchoClient.create(echoSettings); + } +} +// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000000..cb6c708da6 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider1_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build(); + EchoClient echoClient = EchoClient.create(echoSettings); + } +} +// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..ad36585408 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build(); + EchoClient echoClient = EchoClient.create(echoSettings); + } +} +// [END localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java new file mode 100644 index 0000000000..705e8c273b --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Echo_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.Severity; + +public class AsyncEcho { + + public static void main(String[] args) throws Exception { + asyncEcho(); + } + + public static void asyncEcho() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + ApiFuture future = echoClient.echoCallable().futureCall(request); + // Do something. + EchoResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Echo_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java new file mode 100644 index 0000000000..37388425b1 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Echo_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.Severity; + +public class SyncEcho { + + public static void main(String[] args) throws Exception { + syncEcho(); + } + + public static void syncEcho() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .build(); + EchoResponse response = echoClient.echo(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Echo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java new file mode 100644 index 0000000000..80c5f6d6b4 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Expand_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; + +public class AsyncExpand { + + public static void main(String[] args) throws Exception { + asyncExpand(); + } + + public static void asyncExpand() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .build(); + ServerStream stream = echoClient.expandCallable().call(request); + for (EchoResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Expand_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java new file mode 100644 index 0000000000..46257d1453 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpand_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; + +public class AsyncPagedExpand { + + public static void main(String[] args) throws Exception { + asyncPagedExpand(); + } + + public static void asyncPagedExpand() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request); + // Do something. + for (EchoResponse element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpand_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java new file mode 100644 index 0000000000..28a19a69af --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java @@ -0,0 +1,60 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpand_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; + +public class AsyncPagedExpandPaged { + + public static void main(String[] args) throws Exception { + asyncPagedExpandPaged(); + } + + public static void asyncPagedExpandPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + PagedExpandResponse response = echoClient.pagedExpandCallable().call(request); + for (EchoResponse element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpand_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java new file mode 100644 index 0000000000..c9c1a85279 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpand_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; + +public class SyncPagedExpand { + + public static void main(String[] args) throws Exception { + syncPagedExpand(); + } + + public static void syncPagedExpand() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (EchoResponse element : echoClient.pagedExpand(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpand_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java new file mode 100644 index 0000000000..624e4caec1 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; + +public class AsyncPagedExpandLegacy { + + public static void main(String[] args) throws Exception { + asyncPagedExpandLegacy(); + } + + public static void asyncPagedExpandLegacy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + echoClient.pagedExpandLegacyCallable().futureCall(request); + // Do something. + PagedExpandResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java new file mode 100644 index 0000000000..c82b7bbae7 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; + +public class SyncPagedExpandLegacy { + + public static void main(String[] args) throws Exception { + syncPagedExpandLegacy(); + } + + public static void syncPagedExpandLegacy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + PagedExpandResponse response = echoClient.pagedExpandLegacy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java new file mode 100644 index 0000000000..be038a2fb5 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.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. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import java.util.Map; + +public class AsyncPagedExpandLegacyMapped { + + public static void main(String[] args) throws Exception { + asyncPagedExpandLegacyMapped(); + } + + public static void asyncPagedExpandLegacyMapped() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture> future = + echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request); + // Do something. + for (Map.Entry element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java new file mode 100644 index 0000000000..538a3247e8 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java @@ -0,0 +1,62 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import java.util.Map; + +public class AsyncPagedExpandLegacyMappedPaged { + + public static void main(String[] args) throws Exception { + asyncPagedExpandLegacyMappedPaged(); + } + + public static void asyncPagedExpandLegacyMappedPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + PagedExpandLegacyMappedResponse response = + echoClient.pagedExpandLegacyMappedCallable().call(request); + for (Map.Entry element : response.getAlphabetizedList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java new file mode 100644 index 0000000000..2b644c8837 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import java.util.Map; + +public class SyncPagedExpandLegacyMapped { + + public static void main(String[] args) throws Exception { + syncPagedExpandLegacyMapped(); + } + + public static void syncPagedExpandLegacyMapped() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Map.Entry element : + echoClient.pagedExpandLegacyMapped(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java new file mode 100644 index 0000000000..4fe1f78ed2 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Wait_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitRequest; + +public class AsyncWait { + + public static void main(String[] args) throws Exception { + asyncWait(); + } + + public static void asyncWait() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + WaitRequest request = WaitRequest.newBuilder().build(); + ApiFuture future = echoClient.waitCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Wait_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java new file mode 100644 index 0000000000..450ec96d94 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Wait_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; + +public class AsyncWaitLRO { + + public static void main(String[] args) throws Exception { + asyncWaitLRO(); + } + + public static void asyncWaitLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + WaitRequest request = WaitRequest.newBuilder().build(); + OperationFuture future = + echoClient.waitOperationCallable().futureCall(request); + // Do something. + WaitResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Wait_LRO_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java new file mode 100644 index 0000000000..b79a0c4abe --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Wait_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (EchoClient echoClient = EchoClient.create()) { + WaitRequest request = WaitRequest.newBuilder().build(); + WaitResponse response = echoClient.waitAsync(request).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Wait_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java new file mode 100644 index 0000000000..8297f9021e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_EchoSettings_Echo_sync] +import com.google.showcase.v1beta1.EchoSettings; +import java.time.Duration; + +public class SyncEcho { + + public static void main(String[] args) throws Exception { + syncEcho(); + } + + public static void syncEcho() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + echoSettingsBuilder + .echoSettings() + .setRetrySettings( + echoSettingsBuilder + .echoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + EchoSettings echoSettings = echoSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_EchoSettings_Echo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..2ebcf3d498 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + IdentitySettings identitySettings = + IdentitySettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + IdentityClient identityClient = IdentityClient.create(identitySettings); + } +} +// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000000..4ef4b5c388 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider1_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build(); + IdentityClient identityClient = IdentityClient.create(identitySettings); + } +} +// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..56a9453ba2 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + IdentitySettings identitySettings = + IdentitySettings.newBuilder().setEndpoint(myEndpoint).build(); + IdentityClient identityClient = IdentityClient.create(identitySettings); + } +} +// [END localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java new file mode 100644 index 0000000000..6159e29f8b --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_CreateUser_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; + +public class AsyncCreateUser { + + public static void main(String[] args) throws Exception { + asyncCreateUser(); + } + + public static void asyncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build(); + ApiFuture future = identityClient.createUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_CreateUser_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java new file mode 100644 index 0000000000..efced6437d --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_CreateUser_sync] +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build(); + User response = identityClient.createUser(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java new file mode 100644 index 0000000000..54552b0fae --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_CreateUser_StringString_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; + +public class SyncCreateUserStringString { + + public static void main(String[] args) throws Exception { + syncCreateUserStringString(); + } + + public static void syncCreateUserStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + String displayName = "displayName1714148973"; + String email = "email96619420"; + User response = identityClient.createUser(displayName, email); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_CreateUser_StringString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java new file mode 100644 index 0000000000..61705d69f3 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_CreateUser_StringStringIntStringBooleanDouble_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; + +public class SyncCreateUserStringStringIntStringBooleanDouble { + + public static void main(String[] args) throws Exception { + syncCreateUserStringStringIntStringBooleanDouble(); + } + + public static void syncCreateUserStringStringIntStringBooleanDouble() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + User response = + identityClient.createUser( + displayName, email, age, nickname, enableNotifications, heightFeet); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_CreateUser_StringStringIntStringBooleanDouble_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java new file mode 100644 index 0000000000..8d8de43b47 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_DeleteUser_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.UserName; + +public class AsyncDeleteUser { + + public static void main(String[] args) throws Exception { + asyncDeleteUser(); + } + + public static void asyncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); + ApiFuture future = identityClient.deleteUserCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_DeleteUser_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java new file mode 100644 index 0000000000..9bdce522e9 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_DeleteUser_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.UserName; + +public class SyncDeleteUser { + + public static void main(String[] args) throws Exception { + syncDeleteUser(); + } + + public static void syncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); + identityClient.deleteUser(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_DeleteUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java new file mode 100644 index 0000000000..bb894748d3 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_DeleteUser_String_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.UserName; + +public class SyncDeleteUserString { + + public static void main(String[] args) throws Exception { + syncDeleteUserString(); + } + + public static void syncDeleteUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + String name = UserName.of("[USER]").toString(); + identityClient.deleteUser(name); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_DeleteUser_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java new file mode 100644 index 0000000000..b61c33d83c --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_DeleteUser_Username_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.UserName; + +public class SyncDeleteUserUsername { + + public static void main(String[] args) throws Exception { + syncDeleteUserUsername(); + } + + public static void syncDeleteUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + UserName name = UserName.of("[USER]"); + identityClient.deleteUser(name); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_DeleteUser_Username_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java new file mode 100644 index 0000000000..640d726784 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetUser_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.UserName; + +public class AsyncGetUser { + + public static void main(String[] args) throws Exception { + asyncGetUser(); + } + + public static void asyncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); + ApiFuture future = identityClient.getUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetUser_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java new file mode 100644 index 0000000000..9e6adc257c --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetUser_sync] +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.UserName; + +public class SyncGetUser { + + public static void main(String[] args) throws Exception { + syncGetUser(); + } + + public static void syncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); + User response = identityClient.getUser(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java new file mode 100644 index 0000000000..3443054f45 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetUser_String_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.UserName; + +public class SyncGetUserString { + + public static void main(String[] args) throws Exception { + syncGetUserString(); + } + + public static void syncGetUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + String name = UserName.of("[USER]").toString(); + User response = identityClient.getUser(name); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetUser_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java new file mode 100644 index 0000000000..53313b1f09 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetUser_Username_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.UserName; + +public class SyncGetUserUsername { + + public static void main(String[] args) throws Exception { + syncGetUserUsername(); + } + + public static void syncGetUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + UserName name = UserName.of("[USER]"); + User response = identityClient.getUser(name); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetUser_Username_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java new file mode 100644 index 0000000000..b72d2c1f7f --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_ListUsers_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.User; + +public class AsyncListUsers { + + public static void main(String[] args) throws Exception { + asyncListUsers(); + } + + public static void asyncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request); + // Do something. + for (User element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Identity_ListUsers_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java new file mode 100644 index 0000000000..50351698b4 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_ListUsers_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.User; + +public class AsyncListUsersPaged { + + public static void main(String[] args) throws Exception { + asyncListUsersPaged(); + } + + public static void asyncListUsersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListUsersResponse response = identityClient.listUsersCallable().call(request); + for (User element : response.getUsersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Identity_ListUsers_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java new file mode 100644 index 0000000000..ea0578c12a --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_ListUsers_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.User; + +public class SyncListUsers { + + public static void main(String[] args) throws Exception { + syncListUsers(); + } + + public static void syncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (User element : identityClient.listUsers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Identity_ListUsers_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java new file mode 100644 index 0000000000..5d2fc84649 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_UpdateUser_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; + +public class AsyncUpdateUser { + + public static void main(String[] args) throws Exception { + asyncUpdateUser(); + } + + public static void asyncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = identityClient.updateUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_UpdateUser_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java new file mode 100644 index 0000000000..23b62e3bbc --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_UpdateUser_sync] +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; + +public class SyncUpdateUser { + + public static void main(String[] args) throws Exception { + syncUpdateUser(); + } + + public static void syncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (IdentityClient identityClient = IdentityClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + User response = identityClient.updateUser(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_UpdateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java new file mode 100644 index 0000000000..ecc969af0e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] +import com.google.showcase.v1beta1.IdentitySettings; +import java.time.Duration; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder(); + identitySettingsBuilder + .createUserSettings() + .setRetrySettings( + identitySettingsBuilder + .createUserSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + IdentitySettings identitySettings = identitySettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java new file mode 100644 index 0000000000..34f70c0c41 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Connect_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.StreamBlurbsResponse; + +public class AsyncConnect { + + public static void main(String[] args) throws Exception { + asyncConnect(); + } + + public static void asyncConnect() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + BidiStream bidiStream = + messagingClient.connectCallable().call(); + ConnectRequest request = ConnectRequest.newBuilder().build(); + bidiStream.send(request); + for (StreamBlurbsResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_Connect_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..c6c26a4fae --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.MessagingSettings; +import com.google.showcase.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MessagingSettings messagingSettings = + MessagingSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MessagingClient messagingClient = MessagingClient.create(messagingSettings); + } +} +// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000000..ac54a1ca4e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider1_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.MessagingSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build(); + MessagingClient messagingClient = MessagingClient.create(messagingSettings); + } +} +// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..0380588c4a --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.MessagingSettings; +import com.google.showcase.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MessagingSettings messagingSettings = + MessagingSettings.newBuilder().setEndpoint(myEndpoint).build(); + MessagingClient messagingClient = MessagingClient.create(messagingSettings); + } +} +// [END localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java new file mode 100644 index 0000000000..ab21cabfa7 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class AsyncCreateBlurb { + + public static void main(String[] args) throws Exception { + asyncCreateBlurb(); + } + + public static void asyncCreateBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + ApiFuture future = messagingClient.createBlurbCallable().futureCall(request); + // Do something. + Blurb response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java new file mode 100644 index 0000000000..10f979355d --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class SyncCreateBlurb { + + public static void main(String[] args) throws Exception { + syncCreateBlurb(); + } + + public static void syncCreateBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + Blurb response = messagingClient.createBlurb(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java new file mode 100644 index 0000000000..8fe16595eb --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringBytestring_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbProfilenameStringBytestring { + + public static void main(String[] args) throws Exception { + syncCreateBlurbProfilenameStringBytestring(); + } + + public static void syncCreateBlurbProfilenameStringBytestring() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ProfileName parent = ProfileName.of("[USER]"); + String user = UserName.of("[USER]").toString(); + ByteString image = ByteString.EMPTY; + Blurb response = messagingClient.createBlurb(parent, user, image); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringBytestring_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java new file mode 100644 index 0000000000..5d4c8e8986 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringString_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbProfilenameStringString { + + public static void main(String[] args) throws Exception { + syncCreateBlurbProfilenameStringString(); + } + + public static void syncCreateBlurbProfilenameStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ProfileName parent = ProfileName.of("[USER]"); + String user = UserName.of("[USER]").toString(); + String text = "text3556653"; + Blurb response = messagingClient.createBlurb(parent, user, text); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java new file mode 100644 index 0000000000..9c3d7b8c98 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameBytestring_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbProfilenameUsernameBytestring { + + public static void main(String[] args) throws Exception { + syncCreateBlurbProfilenameUsernameBytestring(); + } + + public static void syncCreateBlurbProfilenameUsernameBytestring() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + Blurb response = messagingClient.createBlurb(parent, user, image); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameBytestring_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java new file mode 100644 index 0000000000..f431a92155 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameString_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbProfilenameUsernameString { + + public static void main(String[] args) throws Exception { + syncCreateBlurbProfilenameUsernameString(); + } + + public static void syncCreateBlurbProfilenameUsernameString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + Blurb response = messagingClient.createBlurb(parent, user, text); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java new file mode 100644 index 0000000000..477ed0b163 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringBytestring_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbRoomnameStringBytestring { + + public static void main(String[] args) throws Exception { + syncCreateBlurbRoomnameStringBytestring(); + } + + public static void syncCreateBlurbRoomnameStringBytestring() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName parent = RoomName.of("[ROOM]"); + String user = UserName.of("[USER]").toString(); + ByteString image = ByteString.EMPTY; + Blurb response = messagingClient.createBlurb(parent, user, image); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringBytestring_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java new file mode 100644 index 0000000000..07dc451756 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringString_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbRoomnameStringString { + + public static void main(String[] args) throws Exception { + syncCreateBlurbRoomnameStringString(); + } + + public static void syncCreateBlurbRoomnameStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName parent = RoomName.of("[ROOM]"); + String user = UserName.of("[USER]").toString(); + String text = "text3556653"; + Blurb response = messagingClient.createBlurb(parent, user, text); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java new file mode 100644 index 0000000000..a4cff9e110 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameBytestring_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbRoomnameUsernameBytestring { + + public static void main(String[] args) throws Exception { + syncCreateBlurbRoomnameUsernameBytestring(); + } + + public static void syncCreateBlurbRoomnameUsernameBytestring() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + Blurb response = messagingClient.createBlurb(parent, user, image); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameBytestring_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java new file mode 100644 index 0000000000..5e71b33344 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameString_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbRoomnameUsernameString { + + public static void main(String[] args) throws Exception { + syncCreateBlurbRoomnameUsernameString(); + } + + public static void syncCreateBlurbRoomnameUsernameString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + Blurb response = messagingClient.createBlurb(parent, user, text); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java new file mode 100644 index 0000000000..bfed9b8941 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringBytestring_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbStringStringBytestring { + + public static void main(String[] args) throws Exception { + syncCreateBlurbStringStringBytestring(); + } + + public static void syncCreateBlurbStringStringBytestring() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String parent = ProfileName.of("[USER]").toString(); + String user = UserName.of("[USER]").toString(); + ByteString image = ByteString.EMPTY; + Blurb response = messagingClient.createBlurb(parent, user, image); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringBytestring_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java new file mode 100644 index 0000000000..f2611ad321 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringString_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbStringStringString { + + public static void main(String[] args) throws Exception { + syncCreateBlurbStringStringString(); + } + + public static void syncCreateBlurbStringStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String parent = ProfileName.of("[USER]").toString(); + String user = UserName.of("[USER]").toString(); + String text = "text3556653"; + Blurb response = messagingClient.createBlurb(parent, user, text); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java new file mode 100644 index 0000000000..20ac75deb0 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameBytestring_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbStringUsernameBytestring { + + public static void main(String[] args) throws Exception { + syncCreateBlurbStringUsernameBytestring(); + } + + public static void syncCreateBlurbStringUsernameBytestring() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String parent = ProfileName.of("[USER]").toString(); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + Blurb response = messagingClient.createBlurb(parent, user, image); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameBytestring_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java new file mode 100644 index 0000000000..a9a3cd4af8 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameString_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.UserName; + +public class SyncCreateBlurbStringUsernameString { + + public static void main(String[] args) throws Exception { + syncCreateBlurbStringUsernameString(); + } + + public static void syncCreateBlurbStringUsernameString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String parent = ProfileName.of("[USER]").toString(); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + Blurb response = messagingClient.createBlurb(parent, user, text); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java new file mode 100644 index 0000000000..70a76f23b0 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class AsyncCreateRoom { + + public static void main(String[] args) throws Exception { + asyncCreateRoom(); + } + + public static void asyncCreateRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build(); + ApiFuture future = messagingClient.createRoomCallable().futureCall(request); + // Do something. + Room response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java new file mode 100644 index 0000000000..5aa1b3e94e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class SyncCreateRoom { + + public static void main(String[] args) throws Exception { + syncCreateRoom(); + } + + public static void syncCreateRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build(); + Room response = messagingClient.createRoom(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java new file mode 100644 index 0000000000..7fcd4b7c45 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_StringString_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class SyncCreateRoomStringString { + + public static void main(String[] args) throws Exception { + syncCreateRoomStringString(); + } + + public static void syncCreateRoomStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + Room response = messagingClient.createRoom(displayName, description); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_StringString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java new file mode 100644 index 0000000000..664a34bc76 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncDeleteBlurb { + + public static void main(String[] args) throws Exception { + asyncDeleteBlurb(); + } + + public static void asyncDeleteBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + DeleteBlurbRequest request = + DeleteBlurbRequest.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .build(); + ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java new file mode 100644 index 0000000000..cd93918820 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncDeleteBlurb { + + public static void main(String[] args) throws Exception { + syncDeleteBlurb(); + } + + public static void syncDeleteBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + DeleteBlurbRequest request = + DeleteBlurbRequest.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .build(); + messagingClient.deleteBlurb(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java new file mode 100644 index 0000000000..815c598962 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_Blurbname_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncDeleteBlurbBlurbname { + + public static void main(String[] args) throws Exception { + syncDeleteBlurbBlurbname(); + } + + public static void syncDeleteBlurbBlurbname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + messagingClient.deleteBlurb(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_Blurbname_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java new file mode 100644 index 0000000000..30d35e96cb --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_String_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncDeleteBlurbString { + + public static void main(String[] args) throws Exception { + syncDeleteBlurbString(); + } + + public static void syncDeleteBlurbString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String name = + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString(); + messagingClient.deleteBlurb(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java new file mode 100644 index 0000000000..f521ea0ab6 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; + +public class AsyncDeleteRoom { + + public static void main(String[] args) throws Exception { + asyncDeleteRoom(); + } + + public static void asyncDeleteRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + DeleteRoomRequest request = + DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); + ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java new file mode 100644 index 0000000000..bcb643cbea --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; + +public class SyncDeleteRoom { + + public static void main(String[] args) throws Exception { + syncDeleteRoom(); + } + + public static void syncDeleteRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + DeleteRoomRequest request = + DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); + messagingClient.deleteRoom(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java new file mode 100644 index 0000000000..bed6bd6339 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_Roomname_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; + +public class SyncDeleteRoomRoomname { + + public static void main(String[] args) throws Exception { + syncDeleteRoomRoomname(); + } + + public static void syncDeleteRoomRoomname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName name = RoomName.of("[ROOM]"); + messagingClient.deleteRoom(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_Roomname_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java new file mode 100644 index 0000000000..c8ef55c8f0 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_String_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; + +public class SyncDeleteRoomString { + + public static void main(String[] args) throws Exception { + syncDeleteRoomString(); + } + + public static void syncDeleteRoomString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String name = RoomName.of("[ROOM]").toString(); + messagingClient.deleteRoom(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java new file mode 100644 index 0000000000..3bcdc0dfa2 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncGetBlurb { + + public static void main(String[] args) throws Exception { + asyncGetBlurb(); + } + + public static void asyncGetBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + GetBlurbRequest request = + GetBlurbRequest.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .build(); + ApiFuture future = messagingClient.getBlurbCallable().futureCall(request); + // Do something. + Blurb response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java new file mode 100644 index 0000000000..0ca916ecfb --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncGetBlurb { + + public static void main(String[] args) throws Exception { + syncGetBlurb(); + } + + public static void syncGetBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + GetBlurbRequest request = + GetBlurbRequest.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .build(); + Blurb response = messagingClient.getBlurb(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java new file mode 100644 index 0000000000..8288ba1002 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_Blurbname_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncGetBlurbBlurbname { + + public static void main(String[] args) throws Exception { + syncGetBlurbBlurbname(); + } + + public static void syncGetBlurbBlurbname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + Blurb response = messagingClient.getBlurb(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_Blurbname_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java new file mode 100644 index 0000000000..3a7f190d7b --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_String_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncGetBlurbString { + + public static void main(String[] args) throws Exception { + syncGetBlurbString(); + } + + public static void syncGetBlurbString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String name = + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString(); + Blurb response = messagingClient.getBlurb(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java new file mode 100644 index 0000000000..7449457aec --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetRoom_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.RoomName; + +public class AsyncGetRoom { + + public static void main(String[] args) throws Exception { + asyncGetRoom(); + } + + public static void asyncGetRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + GetRoomRequest request = + GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); + ApiFuture future = messagingClient.getRoomCallable().futureCall(request); + // Do something. + Room response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetRoom_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java new file mode 100644 index 0000000000..50195f0808 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetRoom_sync] +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.RoomName; + +public class SyncGetRoom { + + public static void main(String[] args) throws Exception { + syncGetRoom(); + } + + public static void syncGetRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + GetRoomRequest request = + GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); + Room response = messagingClient.getRoom(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java new file mode 100644 index 0000000000..330ff415e6 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetRoom_Roomname_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.RoomName; + +public class SyncGetRoomRoomname { + + public static void main(String[] args) throws Exception { + syncGetRoomRoomname(); + } + + public static void syncGetRoomRoomname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName name = RoomName.of("[ROOM]"); + Room response = messagingClient.getRoom(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetRoom_Roomname_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java new file mode 100644 index 0000000000..a0d1d29738 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetRoom_String_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.RoomName; + +public class SyncGetRoomString { + + public static void main(String[] args) throws Exception { + syncGetRoomString(); + } + + public static void syncGetRoomString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String name = RoomName.of("[ROOM]").toString(); + Room response = messagingClient.getRoom(name); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetRoom_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java new file mode 100644 index 0000000000..e1ed6b891e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java @@ -0,0 +1,53 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class AsyncListBlurbs { + + public static void main(String[] args) throws Exception { + asyncListBlurbs(); + } + + public static void asyncListBlurbs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request); + // Do something. + for (Blurb element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java new file mode 100644 index 0000000000..4fe5854968 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class AsyncListBlurbsPaged { + + public static void main(String[] args) throws Exception { + asyncListBlurbsPaged(); + } + + public static void asyncListBlurbsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request); + for (Blurb element : response.getBlurbsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java new file mode 100644 index 0000000000..ad1fe7ca00 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class SyncListBlurbs { + + public static void main(String[] args) throws Exception { + syncListBlurbs(); + } + + public static void syncListBlurbs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Blurb element : messagingClient.listBlurbs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java new file mode 100644 index 0000000000..cd576614b4 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_Profilename_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class SyncListBlurbsProfilename { + + public static void main(String[] args) throws Exception { + syncListBlurbsProfilename(); + } + + public static void syncListBlurbsProfilename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ProfileName parent = ProfileName.of("[USER]"); + for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_Profilename_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java new file mode 100644 index 0000000000..e4e34b5327 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_Roomname_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; + +public class SyncListBlurbsRoomname { + + public static void main(String[] args) throws Exception { + syncListBlurbsRoomname(); + } + + public static void syncListBlurbsRoomname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName parent = RoomName.of("[ROOM]"); + for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_Roomname_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java new file mode 100644 index 0000000000..77b1f2b68d --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_String_sync] +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; + +public class SyncListBlurbsString { + + public static void main(String[] args) throws Exception { + syncListBlurbsString(); + } + + public static void syncListBlurbsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String parent = ProfileName.of("[USER]").toString(); + for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java new file mode 100644 index 0000000000..245db794fc --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListRooms_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class AsyncListRooms { + + public static void main(String[] args) throws Exception { + asyncListRooms(); + } + + public static void asyncListRooms() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request); + // Do something. + for (Room element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListRooms_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java new file mode 100644 index 0000000000..faf33d3da5 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListRooms_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class AsyncListRoomsPaged { + + public static void main(String[] args) throws Exception { + asyncListRoomsPaged(); + } + + public static void asyncListRoomsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListRoomsResponse response = messagingClient.listRoomsCallable().call(request); + for (Room element : response.getRoomsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListRooms_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java new file mode 100644 index 0000000000..f8196f7e96 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListRooms_sync] +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class SyncListRooms { + + public static void main(String[] args) throws Exception { + syncListRooms(); + } + + public static void syncListRooms() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Room element : messagingClient.listRooms(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListRooms_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java new file mode 100644 index 0000000000..f74d6da297 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SearchBlurbsRequest; + +public class AsyncSearchBlurbs { + + public static void main(String[] args) throws Exception { + asyncSearchBlurbs(); + } + + public static void asyncSearchBlurbs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setQuery("query107944136") + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java new file mode 100644 index 0000000000..70be85e24a --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.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. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; + +public class AsyncSearchBlurbsLRO { + + public static void main(String[] args) throws Exception { + asyncSearchBlurbsLRO(); + } + + public static void asyncSearchBlurbsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setQuery("query107944136") + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + OperationFuture future = + messagingClient.searchBlurbsOperationCallable().futureCall(request); + // Do something. + SearchBlurbsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_LRO_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java new file mode 100644 index 0000000000..9185a19d58 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; + +public class SyncSearchBlurbs { + + public static void main(String[] args) throws Exception { + syncSearchBlurbs(); + } + + public static void syncSearchBlurbs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setQuery("query107944136") + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(request).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java new file mode 100644 index 0000000000..3601c897d4 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_ProfilenameString_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SearchBlurbsResponse; + +public class SyncSearchBlurbsProfilenameString { + + public static void main(String[] args) throws Exception { + syncSearchBlurbsProfilenameString(); + } + + public static void syncSearchBlurbsProfilenameString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_ProfilenameString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java new file mode 100644 index 0000000000..164a2a0d52 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_RoomnameString_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.RoomName; +import com.google.showcase.v1beta1.SearchBlurbsResponse; + +public class SyncSearchBlurbsRoomnameString { + + public static void main(String[] args) throws Exception { + syncSearchBlurbsRoomnameString(); + } + + public static void syncSearchBlurbsRoomnameString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_RoomnameString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java new file mode 100644 index 0000000000..dffc4662fd --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_StringString_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SearchBlurbsResponse; + +public class SyncSearchBlurbsStringString { + + public static void main(String[] args) throws Exception { + syncSearchBlurbsStringString(); + } + + public static void syncSearchBlurbsStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + String parent = ProfileName.of("[USER]").toString(); + String query = "query107944136"; + SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_StringString_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java new file mode 100644 index 0000000000..88c6d67af7 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java @@ -0,0 +1,68 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SendBlurbs_async] +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SendBlurbsResponse; + +public class AsyncSendBlurbs { + + public static void main(String[] args) throws Exception { + asyncSendBlurbs(); + } + + public static void asyncSendBlurbs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + ApiStreamObserver responseObserver = + new ApiStreamObserver() { + @Override + public void onNext(SendBlurbsResponse response) { + // Do something when a response is received. + } + + @Override + public void onError(Throwable t) { + // Add error-handling + } + + @Override + public void onCompleted() { + // Do something when complete. + } + }; + ApiStreamObserver requestObserver = + messagingClient.sendBlurbs().clientStreamingCall(responseObserver); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + requestObserver.onNext(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SendBlurbs_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java new file mode 100644 index 0000000000..22d85305d4 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java @@ -0,0 +1,53 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_StreamBlurbs_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; + +public class AsyncStreamBlurbs { + + public static void main(String[] args) throws Exception { + asyncStreamBlurbs(); + } + + public static void asyncStreamBlurbs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + ServerStream stream = + messagingClient.streamBlurbsCallable().call(request); + for (StreamBlurbsResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_StreamBlurbs_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java new file mode 100644 index 0000000000..5f26fbdccc --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_UpdateBlurb_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.UpdateBlurbRequest; + +public class AsyncUpdateBlurb { + + public static void main(String[] args) throws Exception { + asyncUpdateBlurb(); + } + + public static void asyncUpdateBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request); + // Do something. + Blurb response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_UpdateBlurb_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java new file mode 100644 index 0000000000..415b326718 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_UpdateBlurb_sync] +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.UpdateBlurbRequest; + +public class SyncUpdateBlurb { + + public static void main(String[] args) throws Exception { + syncUpdateBlurb(); + } + + public static void syncUpdateBlurb() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Blurb response = messagingClient.updateBlurb(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_UpdateBlurb_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java new file mode 100644 index 0000000000..6e7b19ad5c --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_UpdateRoom_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.UpdateRoomRequest; + +public class AsyncUpdateRoom { + + public static void main(String[] args) throws Exception { + asyncUpdateRoom(); + } + + public static void asyncUpdateRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = messagingClient.updateRoomCallable().futureCall(request); + // Do something. + Room response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_UpdateRoom_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java new file mode 100644 index 0000000000..915b84c12e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_UpdateRoom_sync] +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.UpdateRoomRequest; + +public class SyncUpdateRoom { + + public static void main(String[] args) throws Exception { + syncUpdateRoom(); + } + + public static void syncUpdateRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MessagingClient messagingClient = MessagingClient.create()) { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Room response = messagingClient.updateRoom(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_UpdateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java new file mode 100644 index 0000000000..2ab7cbe27e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] +import com.google.showcase.v1beta1.MessagingSettings; +import java.time.Duration; + +public class SyncCreateRoom { + + public static void main(String[] args) throws Exception { + syncCreateRoom(); + } + + public static void syncCreateRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder(); + messagingSettingsBuilder + .createRoomSettings() + .setRetrySettings( + messagingSettingsBuilder + .createRoomSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MessagingSettings messagingSettings = messagingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java new file mode 100644 index 0000000000..b8cbd41577 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.SequenceName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncAttemptSequence { + + public static void main(String[] args) throws Exception { + asyncAttemptSequence(); + } + + public static void asyncAttemptSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + AttemptSequenceRequest request = + AttemptSequenceRequest.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .build(); + ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java new file mode 100644 index 0000000000..3d6637e455 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.SequenceName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncAttemptSequence { + + public static void main(String[] args) throws Exception { + syncAttemptSequence(); + } + + public static void syncAttemptSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + AttemptSequenceRequest request = + AttemptSequenceRequest.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .build(); + sequenceServiceClient.attemptSequence(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java new file mode 100644 index 0000000000..0e9a0ff985 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_Sequencename_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.SequenceName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncAttemptSequenceSequencename { + + public static void main(String[] args) throws Exception { + syncAttemptSequenceSequencename(); + } + + public static void syncAttemptSequenceSequencename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + SequenceName name = SequenceName.of("[SEQUENCE]"); + sequenceServiceClient.attemptSequence(name); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_Sequencename_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java new file mode 100644 index 0000000000..cfc94a15c6 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_String_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.SequenceName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncAttemptSequenceString { + + public static void main(String[] args) throws Exception { + syncAttemptSequenceString(); + } + + public static void syncAttemptSequenceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + String name = SequenceName.of("[SEQUENCE]").toString(); + sequenceServiceClient.attemptSequence(name); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..b1c0a96894 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.SequenceServiceSettings; +import com.google.showcase.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SequenceServiceSettings sequenceServiceSettings = + SequenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SequenceServiceClient sequenceServiceClient = + SequenceServiceClient.create(sequenceServiceSettings); + } +} +// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000000..5f6f2f63f8 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider1_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.SequenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SequenceServiceSettings sequenceServiceSettings = + SequenceServiceSettings.newHttpJsonBuilder().build(); + SequenceServiceClient sequenceServiceClient = + SequenceServiceClient.create(sequenceServiceSettings); + } +} +// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..80d2a57c02 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.SequenceServiceSettings; +import com.google.showcase.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SequenceServiceSettings sequenceServiceSettings = + SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SequenceServiceClient sequenceServiceClient = + SequenceServiceClient.create(sequenceServiceSettings); + } +} +// [END localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java new file mode 100644 index 0000000000..75bd7fdd4a --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncCreateSequence { + + public static void main(String[] args) throws Exception { + asyncCreateSequence(); + } + + public static void asyncCreateSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build(); + ApiFuture future = + sequenceServiceClient.createSequenceCallable().futureCall(request); + // Do something. + Sequence response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java new file mode 100644 index 0000000000..b798739218 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncCreateSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequence(); + } + + public static void syncCreateSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build(); + Sequence response = sequenceServiceClient.createSequence(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java new file mode 100644 index 0000000000..857cf07c55 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_Sequence_sync] +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncCreateSequenceSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequenceSequence(); + } + + public static void syncCreateSequenceSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + Sequence sequence = Sequence.newBuilder().build(); + Sequence response = sequenceServiceClient.createSequence(sequence); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_Sequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java new file mode 100644 index 0000000000..98e96691d7 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.SequenceReportName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncGetSequenceReport { + + public static void main(String[] args) throws Exception { + asyncGetSequenceReport(); + } + + public static void asyncGetSequenceReport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetSequenceReportRequest request = + GetSequenceReportRequest.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .build(); + ApiFuture future = + sequenceServiceClient.getSequenceReportCallable().futureCall(request); + // Do something. + SequenceReport response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java new file mode 100644 index 0000000000..703ffb36fc --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_sync] +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.SequenceReportName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncGetSequenceReport { + + public static void main(String[] args) throws Exception { + syncGetSequenceReport(); + } + + public static void syncGetSequenceReport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetSequenceReportRequest request = + GetSequenceReportRequest.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .build(); + SequenceReport response = sequenceServiceClient.getSequenceReport(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java new file mode 100644 index 0000000000..d40653efc3 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_Sequencereportname_sync] +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.SequenceReportName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncGetSequenceReportSequencereportname { + + public static void main(String[] args) throws Exception { + syncGetSequenceReportSequencereportname(); + } + + public static void syncGetSequenceReportSequencereportname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + SequenceReport response = sequenceServiceClient.getSequenceReport(name); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_Sequencereportname_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java new file mode 100644 index 0000000000..f0ac090a1f --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_String_sync] +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.SequenceReportName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncGetSequenceReportString { + + public static void main(String[] args) throws Exception { + syncGetSequenceReportString(); + } + + public static void syncGetSequenceReportString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + String name = SequenceReportName.of("[SEQUENCE]").toString(); + SequenceReport response = sequenceServiceClient.getSequenceReport(name); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_String_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java new file mode 100644 index 0000000000..d225414159 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] +import com.google.showcase.v1beta1.SequenceServiceSettings; +import java.time.Duration; + +public class SyncCreateSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequence(); + } + + public static void syncCreateSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SequenceServiceSettings.Builder sequenceServiceSettingsBuilder = + SequenceServiceSettings.newBuilder(); + sequenceServiceSettingsBuilder + .createSequenceSettings() + .setRetrySettings( + sequenceServiceSettingsBuilder + .createSequenceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java new file mode 100644 index 0000000000..c0b9e53a5b --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.time.Duration; + +public class SyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + syncRepeatDataBody(); + } + + public static void syncRepeatDataBody() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder(); + complianceSettingsBuilder + .repeatDataBodySettings() + .setRetrySettings( + complianceSettingsBuilder + .repeatDataBodySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java new file mode 100644 index 0000000000..a7a18faf48 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.time.Duration; + +public class SyncEcho { + + public static void main(String[] args) throws Exception { + syncEcho(); + } + + public static void syncEcho() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); + echoSettingsBuilder + .echoSettings() + .setRetrySettings( + echoSettingsBuilder + .echoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + EchoStubSettings echoSettings = echoSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java new file mode 100644 index 0000000000..0413eb47cd --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +import java.time.Duration; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder(); + identitySettingsBuilder + .createUserSettings() + .setRetrySettings( + identitySettingsBuilder + .createUserSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + IdentityStubSettings identitySettings = identitySettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java new file mode 100644 index 0000000000..deffa23fc2 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +import java.time.Duration; + +public class SyncCreateRoom { + + public static void main(String[] args) throws Exception { + syncCreateRoom(); + } + + public static void syncCreateRoom() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder(); + messagingSettingsBuilder + .createRoomSettings() + .setRetrySettings( + messagingSettingsBuilder + .createRoomSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MessagingStubSettings messagingSettings = messagingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java new file mode 100644 index 0000000000..c34917c717 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.time.Duration; + +public class SyncCreateSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequence(); + } + + public static void syncCreateSequence() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder = + SequenceServiceStubSettings.newBuilder(); + sequenceServiceSettingsBuilder + .createSequenceSettings() + .setRetrySettings( + sequenceServiceSettingsBuilder + .createSequenceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java new file mode 100644 index 0000000000..0bac2ef097 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] +import com.google.showcase.v1beta1.stub.TestingStubSettings; +import java.time.Duration; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder(); + testingSettingsBuilder + .createSessionSettings() + .setRetrySettings( + testingSettingsBuilder + .createSessionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TestingStubSettings testingSettings = testingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..54e8f745b6 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.TestingSettings; +import com.google.showcase.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TestingSettings testingSettings = + TestingSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + TestingClient testingClient = TestingClient.create(testingSettings); + } +} +// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000000..98fb47f1f2 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider1_sync] +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.TestingSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build(); + TestingClient testingClient = TestingClient.create(testingSettings); + } +} +// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..31d2c2a00c --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.TestingSettings; +import com.google.showcase.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build(); + TestingClient testingClient = TestingClient.create(testingSettings); + } +} +// [END localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java new file mode 100644 index 0000000000..6706d5fbbf --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_CreateSession_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncCreateSession { + + public static void main(String[] args) throws Exception { + asyncCreateSession(); + } + + public static void asyncCreateSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + ApiFuture future = testingClient.createSessionCallable().futureCall(request); + // Do something. + Session response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_CreateSession_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java new file mode 100644 index 0000000000..1e155623d0 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_CreateSession_sync] +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + Session response = testingClient.createSession(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_CreateSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java new file mode 100644 index 0000000000..38d1dff284 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_DeleteSession_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncDeleteSession { + + public static void main(String[] args) throws Exception { + asyncDeleteSession(); + } + + public static void asyncDeleteSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + ApiFuture future = testingClient.deleteSessionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_DeleteSession_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java new file mode 100644 index 0000000000..d8e1cfcefb --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_DeleteSession_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncDeleteSession { + + public static void main(String[] args) throws Exception { + syncDeleteSession(); + } + + public static void syncDeleteSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + testingClient.deleteSession(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_DeleteSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java new file mode 100644 index 0000000000..bbe7e7edc2 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_DeleteTest_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.TestName; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncDeleteTest { + + public static void main(String[] args) throws Exception { + asyncDeleteTest(); + } + + public static void asyncDeleteTest() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + ApiFuture future = testingClient.deleteTestCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_DeleteTest_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java new file mode 100644 index 0000000000..aa2ad11d74 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_DeleteTest_sync] +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.TestName; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncDeleteTest { + + public static void main(String[] args) throws Exception { + syncDeleteTest(); + } + + public static void syncDeleteTest() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + testingClient.deleteTest(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_DeleteTest_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java new file mode 100644 index 0000000000..f00a7a974b --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_GetSession_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncGetSession { + + public static void main(String[] args) throws Exception { + asyncGetSession(); + } + + public static void asyncGetSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + ApiFuture future = testingClient.getSessionCallable().futureCall(request); + // Do something. + Session response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_GetSession_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java new file mode 100644 index 0000000000..3ed0205286 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_GetSession_sync] +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncGetSession { + + public static void main(String[] args) throws Exception { + syncGetSession(); + } + + public static void syncGetSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + Session response = testingClient.getSession(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_GetSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java new file mode 100644 index 0000000000..416101c8d7 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListSessions_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncListSessions { + + public static void main(String[] args) throws Exception { + asyncListSessions(); + } + + public static void asyncListSessions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request); + // Do something. + for (Session element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListSessions_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java new file mode 100644 index 0000000000..afc3931922 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListSessions_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncListSessionsPaged { + + public static void main(String[] args) throws Exception { + asyncListSessionsPaged(); + } + + public static void asyncListSessionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSessionsResponse response = testingClient.listSessionsCallable().call(request); + for (Session element : response.getSessionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListSessions_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java new file mode 100644 index 0000000000..af3db7796e --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListSessions_sync] +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncListSessions { + + public static void main(String[] args) throws Exception { + syncListSessions(); + } + + public static void syncListSessions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Session element : testingClient.listSessions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListSessions_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java new file mode 100644 index 0000000000..b32136cb50 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java @@ -0,0 +1,53 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListTests_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncListTests { + + public static void main(String[] args) throws Exception { + asyncListTests(); + } + + public static void asyncListTests() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request); + // Do something. + for (Test element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListTests_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java new file mode 100644 index 0000000000..41692c2cdc --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListTests_Paged_async] +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncListTestsPaged { + + public static void main(String[] args) throws Exception { + asyncListTestsPaged(); + } + + public static void asyncListTestsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListTestsResponse response = testingClient.listTestsCallable().call(request); + for (Test element : response.getTestsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListTests_Paged_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java new file mode 100644 index 0000000000..09e918bcbf --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListTests_sync] +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncListTests { + + public static void main(String[] args) throws Exception { + syncListTests(); + } + + public static void syncListTests() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Test element : testingClient.listTests(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListTests_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java new file mode 100644 index 0000000000..b049d290f1 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ReportSession_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncReportSession { + + public static void main(String[] args) throws Exception { + asyncReportSession(); + } + + public static void asyncReportSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + ApiFuture future = + testingClient.reportSessionCallable().futureCall(request); + // Do something. + ReportSessionResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ReportSession_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java new file mode 100644 index 0000000000..1420b6a569 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ReportSession_sync] +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.SessionName; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncReportSession { + + public static void main(String[] args) throws Exception { + syncReportSession(); + } + + public static void syncReportSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + ReportSessionResponse response = testingClient.reportSession(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ReportSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java new file mode 100644 index 0000000000..1c6216b9ba --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java @@ -0,0 +1,53 @@ +/* + * 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.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_VerifyTest_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.TestName; +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import java.util.ArrayList; + +public class AsyncVerifyTest { + + public static void main(String[] args) throws Exception { + asyncVerifyTest(); + } + + public static void asyncVerifyTest() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + ApiFuture future = testingClient.verifyTestCallable().futureCall(request); + // Do something. + VerifyTestResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_VerifyTest_async] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java new file mode 100644 index 0000000000..26ed7c7d1a --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_VerifyTest_sync] +import com.google.protobuf.ByteString; +import com.google.showcase.v1beta1.TestName; +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import java.util.ArrayList; + +public class SyncVerifyTest { + + public static void main(String[] args) throws Exception { + syncVerifyTest(); + } + + public static void syncVerifyTest() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TestingClient testingClient = TestingClient.create()) { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + VerifyTestResponse response = testingClient.verifyTest(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_VerifyTest_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java new file mode 100644 index 0000000000..9fd60bceb9 --- /dev/null +++ b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] +import com.google.showcase.v1beta1.TestingSettings; +import java.time.Duration; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder(); + testingSettingsBuilder + .createSessionSettings() + .setRetrySettings( + testingSettingsBuilder + .createSessionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TestingSettings testingSettings = testingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java new file mode 100644 index 0000000000..c3c458a4dc --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} + */ +public final class AttemptSequenceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptSequenceRequest) + AttemptSequenceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AttemptSequenceRequest.newBuilder() to construct. + private AttemptSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AttemptSequenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AttemptSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AttemptSequenceRequest( + 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.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * 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; + } + } + /** + * 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.showcase.v1beta1.AttemptSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptSequenceRequest other = (com.google.showcase.v1beta1.AttemptSequenceRequest) 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.showcase.v1beta1.AttemptSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptSequenceRequest.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.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest build() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = new com.google.showcase.v1beta1.AttemptSequenceRequest(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.showcase.v1beta1.AttemptSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptSequenceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptSequenceRequest.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.showcase.v1beta1.AttemptSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.AttemptSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * 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; + } + } + /** + * 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; + } + } + /** + * 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; + } + /** + * 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; + } + /** + * 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.showcase.v1beta1.AttemptSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptSequenceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttemptSequenceRequest(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.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..84a1590fb0 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface AttemptSequenceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java new file mode 100644 index 0000000000..3e4863a3be --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java @@ -0,0 +1,1272 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for Block method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ +public final class BlockRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockRequest) + BlockRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BlockRequest.newBuilder() to construct. + private BlockRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BlockRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BlockRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BlockRequest( + 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.Duration.Builder subBuilder = null; + if (responseDelay_ != null) { + subBuilder = responseDelay_.toBuilder(); + } + responseDelay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(responseDelay_); + responseDelay_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.rpc.Status.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = ((com.google.rpc.Status) response_).toBuilder(); + } + response_ = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.rpc.Status) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + break; + } + case 26: { + com.google.showcase.v1beta1.BlockResponse.Builder subBuilder = null; + if (responseCase_ == 3) { + subBuilder = ((com.google.showcase.v1beta1.BlockResponse) response_).toBuilder(); + } + response_ = + input.readMessage(com.google.showcase.v1beta1.BlockResponse.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.BlockResponse) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 3; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + private int responseCase_ = 0; + private java.lang.Object response_; + public enum ResponseCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + private ResponseCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: return ERROR; + case 3: return SUCCESS; + case 0: return RESPONSE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ResponseCase + getResponseCase() { + return ResponseCase.forNumber( + responseCase_); + } + + public static final int RESPONSE_DELAY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration responseDelay_; + /** + *
+   * The amount of time to block before returning a response.
+   * 
+ * + * .google.protobuf.Duration response_delay = 1; + * @return Whether the responseDelay field is set. + */ + @java.lang.Override + public boolean hasResponseDelay() { + return responseDelay_ != null; + } + /** + *
+   * The amount of time to block before returning a response.
+   * 
+ * + * .google.protobuf.Duration response_delay = 1; + * @return The responseDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getResponseDelay() { + return responseDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : responseDelay_; + } + /** + *
+   * The amount of time to block before returning a response.
+   * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + return getResponseDelay(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + /** + *
+   * The response to be returned that will signify successful method call.
+   * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + /** + *
+   * The response to be returned that will signify successful method call.
+   * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + /** + *
+   * The response to be returned that will signify successful method call.
+   * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (responseDelay_ != null) { + output.writeMessage(1, getResponseDelay()); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseDelay_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getResponseDelay()); + } + if (responseCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + 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.showcase.v1beta1.BlockRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockRequest other = (com.google.showcase.v1beta1.BlockRequest) obj; + + if (hasResponseDelay() != other.hasResponseDelay()) return false; + if (hasResponseDelay()) { + if (!getResponseDelay() + .equals(other.getResponseDelay())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError() + .equals(other.getError())) return false; + break; + case 3: + if (!getSuccess() + .equals(other.getSuccess())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasResponseDelay()) { + hash = (37 * hash) + RESPONSE_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getResponseDelay().hashCode(); + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest 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; + } + /** + *
+   * The request for Block method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockRequest) + com.google.showcase.v1beta1.BlockRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockRequest.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 (responseDelayBuilder_ == null) { + responseDelay_ = null; + } else { + responseDelay_ = null; + responseDelayBuilder_ = null; + } + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest build() { + com.google.showcase.v1beta1.BlockRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest buildPartial() { + com.google.showcase.v1beta1.BlockRequest result = new com.google.showcase.v1beta1.BlockRequest(this); + if (responseDelayBuilder_ == null) { + result.responseDelay_ = responseDelay_; + } else { + result.responseDelay_ = responseDelayBuilder_.build(); + } + if (responseCase_ == 2) { + if (errorBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = errorBuilder_.build(); + } + } + if (responseCase_ == 3) { + if (successBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = successBuilder_.build(); + } + } + result.responseCase_ = responseCase_; + 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.showcase.v1beta1.BlockRequest) { + return mergeFrom((com.google.showcase.v1beta1.BlockRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockRequest other) { + if (other == com.google.showcase.v1beta1.BlockRequest.getDefaultInstance()) return this; + if (other.hasResponseDelay()) { + mergeResponseDelay(other.getResponseDelay()); + } + switch (other.getResponseCase()) { + case ERROR: { + mergeError(other.getError()); + break; + } + case SUCCESS: { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.BlockRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.BlockRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int responseCase_ = 0; + private java.lang.Object response_; + public ResponseCase + getResponseCase() { + return ResponseCase.forNumber( + responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.Duration responseDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> responseDelayBuilder_; + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + * @return Whether the responseDelay field is set. + */ + public boolean hasResponseDelay() { + return responseDelayBuilder_ != null || responseDelay_ != null; + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + * @return The responseDelay. + */ + public com.google.protobuf.Duration getResponseDelay() { + if (responseDelayBuilder_ == null) { + return responseDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : responseDelay_; + } else { + return responseDelayBuilder_.getMessage(); + } + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseDelay_ = value; + onChanged(); + } else { + responseDelayBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay( + com.google.protobuf.Duration.Builder builderForValue) { + if (responseDelayBuilder_ == null) { + responseDelay_ = builderForValue.build(); + onChanged(); + } else { + responseDelayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder mergeResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (responseDelay_ != null) { + responseDelay_ = + com.google.protobuf.Duration.newBuilder(responseDelay_).mergeFrom(value).buildPartial(); + } else { + responseDelay_ = value; + } + onChanged(); + } else { + responseDelayBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder clearResponseDelay() { + if (responseDelayBuilder_ == null) { + responseDelay_ = null; + onChanged(); + } else { + responseDelay_ = null; + responseDelayBuilder_ = null; + } + + return this; + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.Duration.Builder getResponseDelayBuilder() { + + onChanged(); + return getResponseDelayFieldBuilder().getBuilder(); + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + if (responseDelayBuilder_ != null) { + return responseDelayBuilder_.getMessageOrBuilder(); + } else { + return responseDelay_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : responseDelay_; + } + } + /** + *
+     * The amount of time to block before returning a response.
+     * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getResponseDelayFieldBuilder() { + if (responseDelayBuilder_ == null) { + responseDelayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getResponseDelay(), + getParentForChildren(), + isClean()); + responseDelay_ = null; + } + return responseDelayBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && + response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value).buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged();; + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, com.google.showcase.v1beta1.BlockResponse.Builder, com.google.showcase.v1beta1.BlockResponseOrBuilder> successBuilder_; + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess( + com.google.showcase.v1beta1.BlockResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 && + response_ != com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) { + response_ = com.google.showcase.v1beta1.BlockResponse.newBuilder((com.google.showcase.v1beta1.BlockResponse) response_) + .mergeFrom(value).buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public com.google.showcase.v1beta1.BlockResponse.Builder getSuccessBuilder() { + return getSuccessFieldBuilder().getBuilder(); + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + /** + *
+     * The response to be returned that will signify successful method call.
+     * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, com.google.showcase.v1beta1.BlockResponse.Builder, com.google.showcase.v1beta1.BlockResponseOrBuilder> + getSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + successBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, com.google.showcase.v1beta1.BlockResponse.Builder, com.google.showcase.v1beta1.BlockResponseOrBuilder>( + (com.google.showcase.v1beta1.BlockResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged();; + return successBuilder_; + } + @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.showcase.v1beta1.BlockRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockRequest) + private static final com.google.showcase.v1beta1.BlockRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockRequest(); + } + + public static com.google.showcase.v1beta1.BlockRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BlockRequest(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.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java new file mode 100644 index 0000000000..81cce93799 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface BlockRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The amount of time to block before returning a response.
+   * 
+ * + * .google.protobuf.Duration response_delay = 1; + * @return Whether the responseDelay field is set. + */ + boolean hasResponseDelay(); + /** + *
+   * The amount of time to block before returning a response.
+   * 
+ * + * .google.protobuf.Duration response_delay = 1; + * @return The responseDelay. + */ + com.google.protobuf.Duration getResponseDelay(); + /** + *
+   * The amount of time to block before returning a response.
+   * 
+ * + * .google.protobuf.Duration response_delay = 1; + */ + com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder(); + + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + boolean hasError(); + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + com.google.rpc.Status getError(); + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + *
+   * The response to be returned that will signify successful method call.
+   * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + * @return Whether the success field is set. + */ + boolean hasSuccess(); + /** + *
+   * The response to be returned that will signify successful method call.
+   * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + * @return The success. + */ + com.google.showcase.v1beta1.BlockResponse getSuccess(); + /** + *
+   * The response to be returned that will signify successful method call.
+   * 
+ * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder(); + + public com.google.showcase.v1beta1.BlockRequest.ResponseCase getResponseCase(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java new file mode 100644 index 0000000000..880c46c04f --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java @@ -0,0 +1,602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response for Block method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ +public final class BlockResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockResponse) + BlockResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use BlockResponse.newBuilder() to construct. + private BlockResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BlockResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BlockResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BlockResponse( + 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(); + + content_ = 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.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + *
+   * This content can contain anything, the server will not depend on a value
+   * here.
+   * 
+ * + * string content = 1; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+   * This content can contain anything, the server will not depend on a value
+   * here.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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.showcase.v1beta1.BlockResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockResponse other = (com.google.showcase.v1beta1.BlockResponse) obj; + + if (!getContent() + .equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse 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; + } + /** + *
+   * The response for Block method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockResponse) + com.google.showcase.v1beta1.BlockResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockResponse.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(); + content_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse build() { + com.google.showcase.v1beta1.BlockResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse buildPartial() { + com.google.showcase.v1beta1.BlockResponse result = new com.google.showcase.v1beta1.BlockResponse(this); + result.content_ = content_; + 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.showcase.v1beta1.BlockResponse) { + return mergeFrom((com.google.showcase.v1beta1.BlockResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockResponse other) { + if (other == com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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.showcase.v1beta1.BlockResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.BlockResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+     * This content can contain anything, the server will not depend on a value
+     * here.
+     * 
+ * + * string content = 1; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * This content can contain anything, the server will not depend on a value
+     * here.
+     * 
+ * + * string content = 1; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * This content can contain anything, the server will not depend on a value
+     * here.
+     * 
+ * + * string content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * This content can contain anything, the server will not depend on a value
+     * here.
+     * 
+ * + * string content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+     * This content can contain anything, the server will not depend on a value
+     * here.
+     * 
+ * + * string content = 1; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = 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.showcase.v1beta1.BlockResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockResponse) + private static final com.google.showcase.v1beta1.BlockResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockResponse(); + } + + public static com.google.showcase.v1beta1.BlockResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BlockResponse(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.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java new file mode 100644 index 0000000000..4730394a4f --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface BlockResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * This content can contain anything, the server will not depend on a value
+   * here.
+   * 
+ * + * string content = 1; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * This content can contain anything, the server will not depend on a value
+   * here.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java new file mode 100644 index 0000000000..8417d72fde --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java @@ -0,0 +1,2177 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * This protocol buffer message represents a blurb sent to a chat room or
+ * posted on a user profile.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ +public final class Blurb extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Blurb) + BlurbOrBuilder { +private static final long serialVersionUID = 0L; + // Use Blurb.newBuilder() to construct. + private Blurb(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Blurb() { + name_ = ""; + user_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Blurb(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Blurb( + 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(); + + user_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 3; + content_ = s; + break; + } + case 34: { + content_ = input.readBytes(); + contentCase_ = 4; + break; + } + case 42: { + 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 50: { + 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 58: { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 7; + legacyId_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 8; + legacyId_ = 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, com.google.showcase.v1beta1.Blurb.Builder.class); + } + + private int contentCase_ = 0; + private java.lang.Object content_; + public enum ContentCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(3), + IMAGE(4), + CONTENT_NOT_SET(0); + private final int value; + private ContentCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 3: return TEXT; + case 4: return IMAGE; + case 0: return CONTENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ContentCase + getContentCase() { + return ContentCase.forNumber( + contentCase_); + } + + private int legacyIdCase_ = 0; + private java.lang.Object legacyId_; + public enum LegacyIdCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEGACY_ROOM_ID(7), + LEGACY_USER_ID(8), + LEGACYID_NOT_SET(0); + private final int value; + private LegacyIdCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LegacyIdCase valueOf(int value) { + return forNumber(value); + } + + public static LegacyIdCase forNumber(int value) { + switch (value) { + case 7: return LEGACY_ROOM_ID; + case 8: return LEGACY_USER_ID; + case 0: return LEGACYID_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public LegacyIdCase + getLegacyIdCase() { + return LegacyIdCase.forNumber( + legacyIdCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @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 USER_FIELD_NUMBER = 2; + private volatile java.lang.Object user_; + /** + *
+   * The resource name of the blurb's author.
+   * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + /** + *
+   * The resource name of the blurb's author.
+   * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_FIELD_NUMBER = 3; + /** + *
+   * The textual content of this blurb.
+   * 
+ * + * string text = 3; + * @return Whether the text field is set. + */ + public boolean hasText() { + return contentCase_ == 3; + } + /** + *
+   * The textual content of this blurb.
+   * 
+ * + * string text = 3; + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 3) { + content_ = s; + } + return s; + } + } + /** + *
+   * The textual content of this blurb.
+   * 
+ * + * string text = 3; + * @return The bytes for text. + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGE_FIELD_NUMBER = 4; + /** + *
+   * The image content of this blurb.
+   * 
+ * + * bytes image = 4; + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return contentCase_ == 4; + } + /** + *
+   * The image content of this blurb.
+   * 
+ * + * bytes image = 4; + * @return The image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * The timestamp at which the blurb was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * The timestamp at which the blurb was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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_; + } + /** + *
+   * The timestamp at which the blurb was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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 = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * The latest timestamp at which the blurb was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * The latest timestamp at which the blurb was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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_; + } + /** + *
+   * The latest timestamp at which the blurb was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LEGACY_ROOM_ID_FIELD_NUMBER = 7; + /** + *
+   * The legacy id of the room. This field is used to signal
+   * the use of the compound resource pattern
+   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+   * 
+ * + * string legacy_room_id = 7; + * @return Whether the legacyRoomId field is set. + */ + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + /** + *
+   * The legacy id of the room. This field is used to signal
+   * the use of the compound resource pattern
+   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+   * 
+ * + * string legacy_room_id = 7; + * @return The legacyRoomId. + */ + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } + } + /** + *
+   * The legacy id of the room. This field is used to signal
+   * the use of the compound resource pattern
+   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+   * 
+ * + * string legacy_room_id = 7; + * @return The bytes for legacyRoomId. + */ + public com.google.protobuf.ByteString + getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEGACY_USER_ID_FIELD_NUMBER = 8; + /** + *
+   * The legacy id of the user. This field is used to signal
+   * the use of the compound resource pattern
+   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+   * 
+ * + * string legacy_user_id = 8; + * @return Whether the legacyUserId field is set. + */ + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + /** + *
+   * The legacy id of the user. This field is used to signal
+   * the use of the compound resource pattern
+   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+   * 
+ * + * string legacy_user_id = 8; + * @return The legacyUserId. + */ + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } + } + /** + *
+   * The legacy id of the user. This field is used to signal
+   * the use of the compound resource pattern
+   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+   * 
+ * + * string legacy_user_id = 8; + * @return The bytes for legacyUserId. + */ + public com.google.protobuf.ByteString + getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(user_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, user_); + } + if (contentCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (contentCase_ == 4) { + output.writeBytes( + 4, (com.google.protobuf.ByteString) content_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, legacyId_); + } + if (legacyIdCase_ == 8) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, legacyId_); + } + 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(user_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, user_); + } + if (contentCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (contentCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 4, (com.google.protobuf.ByteString) content_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, legacyId_); + } + if (legacyIdCase_ == 8) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, legacyId_); + } + 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.showcase.v1beta1.Blurb)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Blurb other = (com.google.showcase.v1beta1.Blurb) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getUser() + .equals(other.getUser())) 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 (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 3: + if (!getText() + .equals(other.getText())) return false; + break; + case 4: + if (!getImage() + .equals(other.getImage())) return false; + break; + case 0: + default: + } + if (!getLegacyIdCase().equals(other.getLegacyIdCase())) return false; + switch (legacyIdCase_) { + case 7: + if (!getLegacyRoomId() + .equals(other.getLegacyRoomId())) return false; + break; + case 8: + if (!getLegacyUserId() + .equals(other.getLegacyUserId())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().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(); + } + switch (contentCase_) { + case 3: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 4: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; + case 0: + default: + } + switch (legacyIdCase_) { + case 7: + hash = (37 * hash) + LEGACY_ROOM_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyRoomId().hashCode(); + break; + case 8: + hash = (37 * hash) + LEGACY_USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyUserId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Blurb parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Blurb parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Blurb parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Blurb parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb 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; + } + /** + *
+   * This protocol buffer message represents a blurb sent to a chat room or
+   * posted on a user profile.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Blurb) + com.google.showcase.v1beta1.BlurbOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, com.google.showcase.v1beta1.Blurb.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Blurb.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_ = ""; + + user_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + contentCase_ = 0; + content_ = null; + legacyIdCase_ = 0; + legacyId_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb build() { + com.google.showcase.v1beta1.Blurb result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb buildPartial() { + com.google.showcase.v1beta1.Blurb result = new com.google.showcase.v1beta1.Blurb(this); + result.name_ = name_; + result.user_ = user_; + if (contentCase_ == 3) { + result.content_ = content_; + } + if (contentCase_ == 4) { + result.content_ = content_; + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (legacyIdCase_ == 7) { + result.legacyId_ = legacyId_; + } + if (legacyIdCase_ == 8) { + result.legacyId_ = legacyId_; + } + result.contentCase_ = contentCase_; + result.legacyIdCase_ = legacyIdCase_; + 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.showcase.v1beta1.Blurb) { + return mergeFrom((com.google.showcase.v1beta1.Blurb)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Blurb other) { + if (other == com.google.showcase.v1beta1.Blurb.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUser().isEmpty()) { + user_ = other.user_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getContentCase()) { + case TEXT: { + contentCase_ = 3; + content_ = other.content_; + onChanged(); + break; + } + case IMAGE: { + setImage(other.getImage()); + break; + } + case CONTENT_NOT_SET: { + break; + } + } + switch (other.getLegacyIdCase()) { + case LEGACY_ROOM_ID: { + legacyIdCase_ = 7; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACY_USER_ID: { + legacyIdCase_ = 8; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACYID_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Blurb parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Blurb) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int contentCase_ = 0; + private java.lang.Object content_; + public ContentCase + getContentCase() { + return ContentCase.forNumber( + contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private int legacyIdCase_ = 0; + private java.lang.Object legacyId_; + public LegacyIdCase + getLegacyIdCase() { + return LegacyIdCase.forNumber( + legacyIdCase_); + } + + public Builder clearLegacyId() { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + return this; + } + + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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; + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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 user_ = ""; + /** + *
+     * The resource name of the blurb's author.
+     * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the blurb's author.
+     * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for user. + */ + public com.google.protobuf.ByteString + getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the blurb's author.
+     * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + user_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the blurb's author.
+     * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearUser() { + + user_ = getDefaultInstance().getUser(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the blurb's author.
+     * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + user_ = value; + onChanged(); + return this; + } + + /** + *
+     * The textual content of this blurb.
+     * 
+ * + * string text = 3; + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return contentCase_ == 3; + } + /** + *
+     * The textual content of this blurb.
+     * 
+ * + * string text = 3; + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 3) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The textual content of this blurb.
+     * 
+ * + * string text = 3; + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The textual content of this blurb.
+     * 
+ * + * string text = 3; + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + /** + *
+     * The textual content of this blurb.
+     * 
+ * + * string text = 3; + * @return This builder for chaining. + */ + public Builder clearText() { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + /** + *
+     * The textual content of this blurb.
+     * 
+ * + * string text = 3; + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + *
+     * The image content of this blurb.
+     * 
+ * + * bytes image = 4; + * @return Whether the image field is set. + */ + public boolean hasImage() { + return contentCase_ == 4; + } + /** + *
+     * The image content of this blurb.
+     * 
+ * + * bytes image = 4; + * @return The image. + */ + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * The image content of this blurb.
+     * 
+ * + * bytes image = 4; + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 4; + content_ = value; + onChanged(); + return this; + } + /** + *
+     * The image content of this blurb.
+     * 
+ * + * bytes image = 4; + * @return This builder for chaining. + */ + public Builder clearImage() { + if (contentCase_ == 4) { + contentCase_ = 0; + content_ = null; + 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_; + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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(); + } + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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; + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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; + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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; + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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_; + } + } + /** + *
+     * The timestamp at which the blurb was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.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_; + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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(); + } + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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; + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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; + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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; + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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_; + } + } + /** + *
+     * The latest timestamp at which the blurb was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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_; + } + + /** + *
+     * The legacy id of the room. This field is used to signal
+     * the use of the compound resource pattern
+     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+     * 
+ * + * string legacy_room_id = 7; + * @return Whether the legacyRoomId field is set. + */ + @java.lang.Override + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + /** + *
+     * The legacy id of the room. This field is used to signal
+     * the use of the compound resource pattern
+     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+     * 
+ * + * string legacy_room_id = 7; + * @return The legacyRoomId. + */ + @java.lang.Override + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The legacy id of the room. This field is used to signal
+     * the use of the compound resource pattern
+     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+     * 
+ * + * string legacy_room_id = 7; + * @return The bytes for legacyRoomId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The legacy id of the room. This field is used to signal
+     * the use of the compound resource pattern
+     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+     * 
+ * + * string legacy_room_id = 7; + * @param value The legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + /** + *
+     * The legacy id of the room. This field is used to signal
+     * the use of the compound resource pattern
+     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+     * 
+ * + * string legacy_room_id = 7; + * @return This builder for chaining. + */ + public Builder clearLegacyRoomId() { + if (legacyIdCase_ == 7) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + /** + *
+     * The legacy id of the room. This field is used to signal
+     * the use of the compound resource pattern
+     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+     * 
+ * + * string legacy_room_id = 7; + * @param value The bytes for legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + *
+     * The legacy id of the user. This field is used to signal
+     * the use of the compound resource pattern
+     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+     * 
+ * + * string legacy_user_id = 8; + * @return Whether the legacyUserId field is set. + */ + @java.lang.Override + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + /** + *
+     * The legacy id of the user. This field is used to signal
+     * the use of the compound resource pattern
+     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+     * 
+ * + * string legacy_user_id = 8; + * @return The legacyUserId. + */ + @java.lang.Override + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The legacy id of the user. This field is used to signal
+     * the use of the compound resource pattern
+     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+     * 
+ * + * string legacy_user_id = 8; + * @return The bytes for legacyUserId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The legacy id of the user. This field is used to signal
+     * the use of the compound resource pattern
+     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+     * 
+ * + * string legacy_user_id = 8; + * @param value The legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + /** + *
+     * The legacy id of the user. This field is used to signal
+     * the use of the compound resource pattern
+     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+     * 
+ * + * string legacy_user_id = 8; + * @return This builder for chaining. + */ + public Builder clearLegacyUserId() { + if (legacyIdCase_ == 8) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + /** + *
+     * The legacy id of the user. This field is used to signal
+     * the use of the compound resource pattern
+     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+     * 
+ * + * string legacy_user_id = 8; + * @param value The bytes for legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 8; + legacyId_ = 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.showcase.v1beta1.Blurb) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Blurb) + private static final com.google.showcase.v1beta1.Blurb DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Blurb(); + } + + public static com.google.showcase.v1beta1.Blurb getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blurb parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Blurb(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.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java new file mode 100644 index 0000000000..32f3ed2380 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -0,0 +1,473 @@ +/* + * 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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 BlurbName implements ResourceName { + private static final PathTemplate USER_LEGACY_USER_BLURB = + PathTemplate.createWithoutUrlEncoding( + "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + private static final PathTemplate USER_BLURB = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); + private static final PathTemplate ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); + private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String user; + private final String legacyUser; + private final String blurb; + private final String room; + private final String legacyRoom; + + @Deprecated + protected BlurbName() { + user = null; + legacyUser = null; + blurb = null; + room = null; + legacyRoom = null; + } + + private BlurbName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + room = null; + legacyRoom = null; + pathTemplate = USER_LEGACY_USER_BLURB; + } + + private BlurbName(UserBlurbBuilder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + legacyUser = null; + room = null; + legacyRoom = null; + pathTemplate = USER_BLURB; + } + + private BlurbName(RoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + legacyRoom = null; + pathTemplate = ROOM_BLURB; + } + + private BlurbName(RoomLegacyRoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + pathTemplate = ROOM_LEGACY_ROOM_BLURB; + } + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newUserLegacyUserBlurbBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static UserBlurbBuilder newUserBlurbBuilder() { + return new UserBlurbBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static RoomBlurbBuilder newRoomBlurbBuilder() { + return new RoomBlurbBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { + return new RoomLegacyRoomBlurbBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BlurbName of(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build(); + } + + public static String format(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build() + .toString(); + } + + public static BlurbName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (USER_LEGACY_USER_BLURB.matches(formattedString)) { + Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); + return ofUserLegacyUserBlurbName( + matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); + } else if (USER_BLURB.matches(formattedString)) { + Map matchMap = USER_BLURB.match(formattedString); + return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); + } else if (ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_BLURB.match(formattedString); + return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); + } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); + return ofRoomLegacyRoomBlurbName( + matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); + } + throw new ValidationException("BlurbName.parse: formattedString not in valid format"); + } + + 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 (BlurbName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_LEGACY_USER_BLURB.matches(formattedString) + || USER_BLURB.matches(formattedString) + || ROOM_BLURB.matches(formattedString) + || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (legacyUser != null) { + fieldMapBuilder.put("legacy_user", legacyUser); + } + if (blurb != null) { + fieldMapBuilder.put("blurb", blurb); + } + if (room != null) { + fieldMapBuilder.put("room", room); + } + if (legacyRoom != null) { + fieldMapBuilder.put("legacy_room", legacyRoom); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BlurbName that = ((BlurbName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.legacyUser, that.legacyUser) + && Objects.equals(this.blurb, that.blurb) + && Objects.equals(this.room, that.room) + && Objects.equals(this.legacyRoom, that.legacyRoom); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(legacyUser); + h *= 1000003; + h ^= Objects.hashCode(blurb); + h *= 1000003; + h ^= Objects.hashCode(room); + h *= 1000003; + h ^= Objects.hashCode(legacyRoom); + return h; + } + + /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ + public static class Builder { + private String user; + private String legacyUser; + private String blurb; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setLegacyUser(String legacyUser) { + this.legacyUser = legacyUser; + return this; + } + + public Builder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + private Builder(BlurbName blurbName) { + Preconditions.checkArgument( + Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), + "toBuilder is only supported when BlurbName has the pattern of users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + this.user = blurbName.user; + this.legacyUser = blurbName.legacyUser; + this.blurb = blurbName.blurb; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for users/{user}/profile/blurbs/{blurb}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class UserBlurbBuilder { + private String user; + private String blurb; + + protected UserBlurbBuilder() {} + + public String getUser() { + return user; + } + + public String getBlurb() { + return blurb; + } + + public UserBlurbBuilder setUser(String user) { + this.user = user; + return this; + } + + public UserBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/{blurb}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class RoomBlurbBuilder { + private String room; + private String blurb; + + protected RoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getBlurb() { + return blurb; + } + + public RoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class RoomLegacyRoomBlurbBuilder { + private String room; + private String legacyRoom; + private String blurb; + + protected RoomLegacyRoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public String getBlurb() { + return blurb; + } + + public RoomLegacyRoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { + this.legacyRoom = legacyRoom; + return this; + } + + public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java new file mode 100644 index 0000000000..08af31258d --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java @@ -0,0 +1,225 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface BlurbOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Blurb) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The resource name of the blurb's author.
+   * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The user. + */ + java.lang.String getUser(); + /** + *
+   * The resource name of the blurb's author.
+   * 
+ * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for user. + */ + com.google.protobuf.ByteString + getUserBytes(); + + /** + *
+   * The textual content of this blurb.
+   * 
+ * + * string text = 3; + * @return Whether the text field is set. + */ + boolean hasText(); + /** + *
+   * The textual content of this blurb.
+   * 
+ * + * string text = 3; + * @return The text. + */ + java.lang.String getText(); + /** + *
+   * The textual content of this blurb.
+   * 
+ * + * string text = 3; + * @return The bytes for text. + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + *
+   * The image content of this blurb.
+   * 
+ * + * bytes image = 4; + * @return Whether the image field is set. + */ + boolean hasImage(); + /** + *
+   * The image content of this blurb.
+   * 
+ * + * bytes image = 4; + * @return The image. + */ + com.google.protobuf.ByteString getImage(); + + /** + *
+   * The timestamp at which the blurb was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + *
+   * The timestamp at which the blurb was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * The timestamp at which the blurb was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * The latest timestamp at which the blurb was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + *
+   * The latest timestamp at which the blurb was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * The latest timestamp at which the blurb was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + *
+   * The legacy id of the room. This field is used to signal
+   * the use of the compound resource pattern
+   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+   * 
+ * + * string legacy_room_id = 7; + * @return Whether the legacyRoomId field is set. + */ + boolean hasLegacyRoomId(); + /** + *
+   * The legacy id of the room. This field is used to signal
+   * the use of the compound resource pattern
+   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+   * 
+ * + * string legacy_room_id = 7; + * @return The legacyRoomId. + */ + java.lang.String getLegacyRoomId(); + /** + *
+   * The legacy id of the room. This field is used to signal
+   * the use of the compound resource pattern
+   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
+   * 
+ * + * string legacy_room_id = 7; + * @return The bytes for legacyRoomId. + */ + com.google.protobuf.ByteString + getLegacyRoomIdBytes(); + + /** + *
+   * The legacy id of the user. This field is used to signal
+   * the use of the compound resource pattern
+   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+   * 
+ * + * string legacy_user_id = 8; + * @return Whether the legacyUserId field is set. + */ + boolean hasLegacyUserId(); + /** + *
+   * The legacy id of the user. This field is used to signal
+   * the use of the compound resource pattern
+   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+   * 
+ * + * string legacy_user_id = 8; + * @return The legacyUserId. + */ + java.lang.String getLegacyUserId(); + /** + *
+   * The legacy id of the user. This field is used to signal
+   * the use of the compound resource pattern
+   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
+   * 
+ * + * string legacy_user_id = 8; + * @return The bytes for legacyUserId. + */ + com.google.protobuf.ByteString + getLegacyUserIdBytes(); + + public com.google.showcase.v1beta1.Blurb.ContentCase getContentCase(); + + public com.google.showcase.v1beta1.Blurb.LegacyIdCase getLegacyIdCase(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java new file mode 100644 index 0000000000..3d5de37762 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java @@ -0,0 +1,2662 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * ComplianceData is a message used for testing REST transcoding of
+ * different data types.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ +public final class ComplianceData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceData) + ComplianceDataOrBuilder { +private static final long serialVersionUID = 0L; + // Use ComplianceData.newBuilder() to construct. + private ComplianceData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ComplianceData() { + fString_ = ""; + fBytes_ = com.google.protobuf.ByteString.EMPTY; + fKingdom_ = 0; + pString_ = ""; + pKingdom_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ComplianceData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ComplianceData( + 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(); + + fString_ = s; + break; + } + case 16: { + + fInt32_ = input.readInt32(); + break; + } + case 24: { + + fSint32_ = input.readSInt32(); + break; + } + case 37: { + + fSfixed32_ = input.readSFixed32(); + break; + } + case 40: { + + fUint32_ = input.readUInt32(); + break; + } + case 53: { + + fFixed32_ = input.readFixed32(); + break; + } + case 56: { + + fInt64_ = input.readInt64(); + break; + } + case 64: { + + fSint64_ = input.readSInt64(); + break; + } + case 73: { + + fSfixed64_ = input.readSFixed64(); + break; + } + case 80: { + + fUint64_ = input.readUInt64(); + break; + } + case 89: { + + fFixed64_ = input.readFixed64(); + break; + } + case 97: { + + fDouble_ = input.readDouble(); + break; + } + case 109: { + + fFloat_ = input.readFloat(); + break; + } + case 112: { + + fBool_ = input.readBool(); + break; + } + case 122: { + + fBytes_ = input.readBytes(); + break; + } + case 130: { + com.google.showcase.v1beta1.ComplianceDataChild.Builder subBuilder = null; + if (fChild_ != null) { + subBuilder = fChild_.toBuilder(); + } + fChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataChild.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fChild_); + fChild_ = subBuilder.buildPartial(); + } + + break; + } + case 138: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + pString_ = s; + break; + } + case 144: { + bitField0_ |= 0x00000002; + pInt32_ = input.readInt32(); + break; + } + case 153: { + bitField0_ |= 0x00000004; + pDouble_ = input.readDouble(); + break; + } + case 160: { + bitField0_ |= 0x00000008; + pBool_ = input.readBool(); + break; + } + case 170: { + com.google.showcase.v1beta1.ComplianceDataChild.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) != 0)) { + subBuilder = pChild_.toBuilder(); + } + pChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataChild.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pChild_); + pChild_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 176: { + int rawValue = input.readEnum(); + + fKingdom_ = rawValue; + break; + } + case 184: { + int rawValue = input.readEnum(); + bitField0_ |= 0x00000010; + pKingdom_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + /** + * Protobuf enum {@code google.showcase.v1beta1.ComplianceData.LifeKingdom} + */ + public enum LifeKingdom + implements com.google.protobuf.ProtocolMessageEnum { + /** + * LIFE_KINGDOM_UNSPECIFIED = 0; + */ + LIFE_KINGDOM_UNSPECIFIED(0), + /** + * ARCHAEBACTERIA = 1; + */ + ARCHAEBACTERIA(1), + /** + * EUBACTERIA = 2; + */ + EUBACTERIA(2), + /** + * PROTISTA = 3; + */ + PROTISTA(3), + /** + * FUNGI = 4; + */ + FUNGI(4), + /** + * PLANTAE = 5; + */ + PLANTAE(5), + /** + * ANIMALIA = 6; + */ + ANIMALIA(6), + UNRECOGNIZED(-1), + ; + + /** + * LIFE_KINGDOM_UNSPECIFIED = 0; + */ + public static final int LIFE_KINGDOM_UNSPECIFIED_VALUE = 0; + /** + * ARCHAEBACTERIA = 1; + */ + public static final int ARCHAEBACTERIA_VALUE = 1; + /** + * EUBACTERIA = 2; + */ + public static final int EUBACTERIA_VALUE = 2; + /** + * PROTISTA = 3; + */ + public static final int PROTISTA_VALUE = 3; + /** + * FUNGI = 4; + */ + public static final int FUNGI_VALUE = 4; + /** + * PLANTAE = 5; + */ + public static final int PLANTAE_VALUE = 5; + /** + * ANIMALIA = 6; + */ + public static final int ANIMALIA_VALUE = 6; + + + 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 LifeKingdom 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 LifeKingdom forNumber(int value) { + switch (value) { + case 0: return LIFE_KINGDOM_UNSPECIFIED; + case 1: return ARCHAEBACTERIA; + case 2: return EUBACTERIA; + case 3: return PROTISTA; + case 4: return FUNGI; + case 5: return PLANTAE; + case 6: return ANIMALIA; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + LifeKingdom> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public LifeKingdom findValueByNumber(int number) { + return LifeKingdom.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.showcase.v1beta1.ComplianceData.getDescriptor().getEnumTypes().get(0); + } + + private static final LifeKingdom[] VALUES = values(); + + public static LifeKingdom 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 LifeKingdom(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ComplianceData.LifeKingdom) + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + private volatile java.lang.Object fString_; + /** + * string f_string = 1; + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + /** + * string f_string = 1; + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 2; + private int fInt32_; + /** + * int32 f_int32 = 2; + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_SINT32_FIELD_NUMBER = 3; + private int fSint32_; + /** + * sint32 f_sint32 = 3; + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + public static final int F_SFIXED32_FIELD_NUMBER = 4; + private int fSfixed32_; + /** + * sfixed32 f_sfixed32 = 4; + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + public static final int F_UINT32_FIELD_NUMBER = 5; + private int fUint32_; + /** + * uint32 f_uint32 = 5; + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + public static final int F_FIXED32_FIELD_NUMBER = 6; + private int fFixed32_; + /** + * fixed32 f_fixed32 = 6; + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + public static final int F_INT64_FIELD_NUMBER = 7; + private long fInt64_; + /** + * int64 f_int64 = 7; + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_SINT64_FIELD_NUMBER = 8; + private long fSint64_; + /** + * sint64 f_sint64 = 8; + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + public static final int F_SFIXED64_FIELD_NUMBER = 9; + private long fSfixed64_; + /** + * sfixed64 f_sfixed64 = 9; + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + public static final int F_UINT64_FIELD_NUMBER = 10; + private long fUint64_; + /** + * uint64 f_uint64 = 10; + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + public static final int F_FIXED64_FIELD_NUMBER = 11; + private long fFixed64_; + /** + * fixed64 f_fixed64 = 11; + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 12; + private double fDouble_; + /** + * double f_double = 12; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_FLOAT_FIELD_NUMBER = 13; + private float fFloat_; + /** + * float f_float = 13; + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_BOOL_FIELD_NUMBER = 14; + private boolean fBool_; + /** + * bool f_bool = 14; + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_BYTES_FIELD_NUMBER = 15; + private com.google.protobuf.ByteString fBytes_; + /** + * bytes f_bytes = 15; + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + public static final int F_KINGDOM_FIELD_NUMBER = 22; + private int fKingdom_; + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override public int getFKingdomValue() { + return fKingdom_; + } + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return The fKingdom. + */ + @java.lang.Override public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(fKingdom_); + return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 16; + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return fChild_ != null; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : fChild_; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + return getFChild(); + } + + public static final int P_STRING_FIELD_NUMBER = 17; + private volatile java.lang.Object pString_; + /** + * optional string p_string = 17; + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string p_string = 17; + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + /** + * optional string p_string = 17; + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_INT32_FIELD_NUMBER = 18; + private int pInt32_; + /** + * optional int32 p_int32 = 18; + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional int32 p_int32 = 18; + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 19; + private double pDouble_; + /** + * optional double p_double = 19; + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double p_double = 19; + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 20; + private boolean pBool_; + /** + * optional bool p_bool = 20; + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional bool p_bool = 20; + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_KINGDOM_FIELD_NUMBER = 23; + private int pKingdom_; + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return Whether the pKingdom field is set. + */ + @java.lang.Override public boolean hasPKingdom() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override public int getPKingdomValue() { + return pKingdom_; + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return The pKingdom. + */ + @java.lang.Override public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(pKingdom_); + return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 21; + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (fInt32_ != 0) { + output.writeInt32(2, fInt32_); + } + if (fSint32_ != 0) { + output.writeSInt32(3, fSint32_); + } + if (fSfixed32_ != 0) { + output.writeSFixed32(4, fSfixed32_); + } + if (fUint32_ != 0) { + output.writeUInt32(5, fUint32_); + } + if (fFixed32_ != 0) { + output.writeFixed32(6, fFixed32_); + } + if (fInt64_ != 0L) { + output.writeInt64(7, fInt64_); + } + if (fSint64_ != 0L) { + output.writeSInt64(8, fSint64_); + } + if (fSfixed64_ != 0L) { + output.writeSFixed64(9, fSfixed64_); + } + if (fUint64_ != 0L) { + output.writeUInt64(10, fUint64_); + } + if (fFixed64_ != 0L) { + output.writeFixed64(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(13, fFloat_); + } + if (fBool_ != false) { + output.writeBool(14, fBool_); + } + if (!fBytes_.isEmpty()) { + output.writeBytes(15, fBytes_); + } + if (fChild_ != null) { + output.writeMessage(16, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(18, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(19, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(20, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(21, getPChild()); + } + if (fKingdom_ != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED.getNumber()) { + output.writeEnum(22, fKingdom_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeEnum(23, pKingdom_); + } + 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(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, fInt32_); + } + if (fSint32_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(3, fSint32_); + } + if (fSfixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(4, fSfixed32_); + } + if (fUint32_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, fUint32_); + } + if (fFixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(6, fFixed32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, fInt64_); + } + if (fSint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(8, fSint64_); + } + if (fSfixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(9, fSfixed64_); + } + if (fUint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(10, fUint64_); + } + if (fFixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(13, fFloat_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, fBool_); + } + if (!fBytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(15, fBytes_); + } + if (fChild_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(19, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(20, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(21, getPChild()); + } + if (fKingdom_ != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(22, fKingdom_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(23, pKingdom_); + } + 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.showcase.v1beta1.ComplianceData)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceData other = (com.google.showcase.v1beta1.ComplianceData) obj; + + if (!getFString() + .equals(other.getFString())) return false; + if (getFInt32() + != other.getFInt32()) return false; + if (getFSint32() + != other.getFSint32()) return false; + if (getFSfixed32() + != other.getFSfixed32()) return false; + if (getFUint32() + != other.getFUint32()) return false; + if (getFFixed32() + != other.getFFixed32()) return false; + if (getFInt64() + != other.getFInt64()) return false; + if (getFSint64() + != other.getFSint64()) return false; + if (getFSfixed64() + != other.getFSfixed64()) return false; + if (getFUint64() + != other.getFUint64()) return false; + if (getFFixed64() + != other.getFFixed64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits( + other.getFDouble())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits( + other.getFFloat())) return false; + if (getFBool() + != other.getFBool()) return false; + if (!getFBytes() + .equals(other.getFBytes())) return false; + if (fKingdom_ != other.fKingdom_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild() + .equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString() + .equals(other.getPString())) return false; + } + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() + != other.getPInt32()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits( + other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() + != other.getPBool()) return false; + } + if (hasPKingdom() != other.hasPKingdom()) return false; + if (hasPKingdom()) { + if (pKingdom_ != other.pKingdom_) return false; + } + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild() + .equals(other.getPChild())) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_SINT32_FIELD_NUMBER; + hash = (53 * hash) + getFSint32(); + hash = (37 * hash) + F_SFIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFSfixed32(); + hash = (37 * hash) + F_UINT32_FIELD_NUMBER; + hash = (53 * hash) + getFUint32(); + hash = (37 * hash) + F_FIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFFixed32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFInt64()); + hash = (37 * hash) + F_SINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFSint64()); + hash = (37 * hash) + F_SFIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFSfixed64()); + hash = (37 * hash) + F_UINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFUint64()); + hash = (37 * hash) + F_FIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFFixed64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFFloat()); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFBool()); + hash = (37 * hash) + F_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getFBytes().hashCode(); + hash = (37 * hash) + F_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + fKingdom_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPBool()); + } + if (hasPKingdom()) { + hash = (37 * hash) + P_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + pKingdom_; + } + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData 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; + } + /** + *
+   * ComplianceData is a message used for testing REST transcoding of
+   * different data types.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceData) + com.google.showcase.v1beta1.ComplianceDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPChildFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + fString_ = ""; + + fInt32_ = 0; + + fSint32_ = 0; + + fSfixed32_ = 0; + + fUint32_ = 0; + + fFixed32_ = 0; + + fInt64_ = 0L; + + fSint64_ = 0L; + + fSfixed64_ = 0L; + + fUint64_ = 0L; + + fFixed64_ = 0L; + + fDouble_ = 0D; + + fFloat_ = 0F; + + fBool_ = false; + + fBytes_ = com.google.protobuf.ByteString.EMPTY; + + fKingdom_ = 0; + + if (fChildBuilder_ == null) { + fChild_ = null; + } else { + fChild_ = null; + fChildBuilder_ = null; + } + pString_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + pInt32_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + pDouble_ = 0D; + bitField0_ = (bitField0_ & ~0x00000004); + pBool_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + pKingdom_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + if (pChildBuilder_ == null) { + pChild_ = null; + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData build() { + com.google.showcase.v1beta1.ComplianceData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData buildPartial() { + com.google.showcase.v1beta1.ComplianceData result = new com.google.showcase.v1beta1.ComplianceData(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.fString_ = fString_; + result.fInt32_ = fInt32_; + result.fSint32_ = fSint32_; + result.fSfixed32_ = fSfixed32_; + result.fUint32_ = fUint32_; + result.fFixed32_ = fFixed32_; + result.fInt64_ = fInt64_; + result.fSint64_ = fSint64_; + result.fSfixed64_ = fSfixed64_; + result.fUint64_ = fUint64_; + result.fFixed64_ = fFixed64_; + result.fDouble_ = fDouble_; + result.fFloat_ = fFloat_; + result.fBool_ = fBool_; + result.fBytes_ = fBytes_; + result.fKingdom_ = fKingdom_; + if (fChildBuilder_ == null) { + result.fChild_ = fChild_; + } else { + result.fChild_ = fChildBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.pString_ = pString_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + to_bitField0_ |= 0x00000010; + } + result.pKingdom_ = pKingdom_; + if (((from_bitField0_ & 0x00000020) != 0)) { + if (pChildBuilder_ == null) { + result.pChild_ = pChild_; + } else { + result.pChild_ = pChildBuilder_.build(); + } + to_bitField0_ |= 0x00000020; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.ComplianceData) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceData other) { + if (other == com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFSint32() != 0) { + setFSint32(other.getFSint32()); + } + if (other.getFSfixed32() != 0) { + setFSfixed32(other.getFSfixed32()); + } + if (other.getFUint32() != 0) { + setFUint32(other.getFUint32()); + } + if (other.getFFixed32() != 0) { + setFFixed32(other.getFFixed32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFSint64() != 0L) { + setFSint64(other.getFSint64()); + } + if (other.getFSfixed64() != 0L) { + setFSfixed64(other.getFSfixed64()); + } + if (other.getFUint64() != 0L) { + setFUint64(other.getFUint64()); + } + if (other.getFFixed64() != 0L) { + setFFixed64(other.getFFixed64()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFFloat() != 0F) { + setFFloat(other.getFFloat()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.getFBytes() != com.google.protobuf.ByteString.EMPTY) { + setFBytes(other.getFBytes()); + } + if (other.fKingdom_ != 0) { + setFKingdomValue(other.getFKingdomValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + bitField0_ |= 0x00000001; + pString_ = other.pString_; + onChanged(); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.hasPKingdom()) { + setPKingdom(other.getPKingdom()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + 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.showcase.v1beta1.ComplianceData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object fString_ = ""; + /** + * string f_string = 1; + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string f_string = 1; + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString + getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string f_string = 1; + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fString_ = value; + onChanged(); + return this; + } + /** + * string f_string = 1; + * @return This builder for chaining. + */ + public Builder clearFString() { + + fString_ = getDefaultInstance().getFString(); + onChanged(); + return this; + } + /** + * string f_string = 1; + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fString_ = value; + onChanged(); + return this; + } + + private int fInt32_ ; + /** + * int32 f_int32 = 2; + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + /** + * int32 f_int32 = 2; + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + onChanged(); + return this; + } + /** + * int32 f_int32 = 2; + * @return This builder for chaining. + */ + public Builder clearFInt32() { + + fInt32_ = 0; + onChanged(); + return this; + } + + private int fSint32_ ; + /** + * sint32 f_sint32 = 3; + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + /** + * sint32 f_sint32 = 3; + * @param value The fSint32 to set. + * @return This builder for chaining. + */ + public Builder setFSint32(int value) { + + fSint32_ = value; + onChanged(); + return this; + } + /** + * sint32 f_sint32 = 3; + * @return This builder for chaining. + */ + public Builder clearFSint32() { + + fSint32_ = 0; + onChanged(); + return this; + } + + private int fSfixed32_ ; + /** + * sfixed32 f_sfixed32 = 4; + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + /** + * sfixed32 f_sfixed32 = 4; + * @param value The fSfixed32 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed32(int value) { + + fSfixed32_ = value; + onChanged(); + return this; + } + /** + * sfixed32 f_sfixed32 = 4; + * @return This builder for chaining. + */ + public Builder clearFSfixed32() { + + fSfixed32_ = 0; + onChanged(); + return this; + } + + private int fUint32_ ; + /** + * uint32 f_uint32 = 5; + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + /** + * uint32 f_uint32 = 5; + * @param value The fUint32 to set. + * @return This builder for chaining. + */ + public Builder setFUint32(int value) { + + fUint32_ = value; + onChanged(); + return this; + } + /** + * uint32 f_uint32 = 5; + * @return This builder for chaining. + */ + public Builder clearFUint32() { + + fUint32_ = 0; + onChanged(); + return this; + } + + private int fFixed32_ ; + /** + * fixed32 f_fixed32 = 6; + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + /** + * fixed32 f_fixed32 = 6; + * @param value The fFixed32 to set. + * @return This builder for chaining. + */ + public Builder setFFixed32(int value) { + + fFixed32_ = value; + onChanged(); + return this; + } + /** + * fixed32 f_fixed32 = 6; + * @return This builder for chaining. + */ + public Builder clearFFixed32() { + + fFixed32_ = 0; + onChanged(); + return this; + } + + private long fInt64_ ; + /** + * int64 f_int64 = 7; + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + /** + * int64 f_int64 = 7; + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + onChanged(); + return this; + } + /** + * int64 f_int64 = 7; + * @return This builder for chaining. + */ + public Builder clearFInt64() { + + fInt64_ = 0L; + onChanged(); + return this; + } + + private long fSint64_ ; + /** + * sint64 f_sint64 = 8; + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + /** + * sint64 f_sint64 = 8; + * @param value The fSint64 to set. + * @return This builder for chaining. + */ + public Builder setFSint64(long value) { + + fSint64_ = value; + onChanged(); + return this; + } + /** + * sint64 f_sint64 = 8; + * @return This builder for chaining. + */ + public Builder clearFSint64() { + + fSint64_ = 0L; + onChanged(); + return this; + } + + private long fSfixed64_ ; + /** + * sfixed64 f_sfixed64 = 9; + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + /** + * sfixed64 f_sfixed64 = 9; + * @param value The fSfixed64 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed64(long value) { + + fSfixed64_ = value; + onChanged(); + return this; + } + /** + * sfixed64 f_sfixed64 = 9; + * @return This builder for chaining. + */ + public Builder clearFSfixed64() { + + fSfixed64_ = 0L; + onChanged(); + return this; + } + + private long fUint64_ ; + /** + * uint64 f_uint64 = 10; + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + /** + * uint64 f_uint64 = 10; + * @param value The fUint64 to set. + * @return This builder for chaining. + */ + public Builder setFUint64(long value) { + + fUint64_ = value; + onChanged(); + return this; + } + /** + * uint64 f_uint64 = 10; + * @return This builder for chaining. + */ + public Builder clearFUint64() { + + fUint64_ = 0L; + onChanged(); + return this; + } + + private long fFixed64_ ; + /** + * fixed64 f_fixed64 = 11; + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + /** + * fixed64 f_fixed64 = 11; + * @param value The fFixed64 to set. + * @return This builder for chaining. + */ + public Builder setFFixed64(long value) { + + fFixed64_ = value; + onChanged(); + return this; + } + /** + * fixed64 f_fixed64 = 11; + * @return This builder for chaining. + */ + public Builder clearFFixed64() { + + fFixed64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_ ; + /** + * double f_double = 12; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + /** + * double f_double = 12; + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + /** + * double f_double = 12; + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private float fFloat_ ; + /** + * float f_float = 13; + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + /** + * float f_float = 13; + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + onChanged(); + return this; + } + /** + * float f_float = 13; + * @return This builder for chaining. + */ + public Builder clearFFloat() { + + fFloat_ = 0F; + onChanged(); + return this; + } + + private boolean fBool_ ; + /** + * bool f_bool = 14; + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + /** + * bool f_bool = 14; + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + onChanged(); + return this; + } + /** + * bool f_bool = 14; + * @return This builder for chaining. + */ + public Builder clearFBool() { + + fBool_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes f_bytes = 15; + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + /** + * bytes f_bytes = 15; + * @param value The fBytes to set. + * @return This builder for chaining. + */ + public Builder setFBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + fBytes_ = value; + onChanged(); + return this; + } + /** + * bytes f_bytes = 15; + * @return This builder for chaining. + */ + public Builder clearFBytes() { + + fBytes_ = getDefaultInstance().getFBytes(); + onChanged(); + return this; + } + + private int fKingdom_ = 0; + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override public int getFKingdomValue() { + return fKingdom_; + } + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @param value The enum numeric value on the wire for fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdomValue(int value) { + + fKingdom_ = value; + onChanged(); + return this; + } + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(fKingdom_); + return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; + } + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @param value The fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + + fKingdom_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return This builder for chaining. + */ + public Builder clearFKingdom() { + + fKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> fChildBuilder_; + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return fChildBuilder_ != null || fChild_ != null; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + onChanged(); + } else { + fChildBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + onChanged(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (fChild_ != null) { + fChild_ = + com.google.showcase.v1beta1.ComplianceDataChild.newBuilder(fChild_).mergeFrom(value).buildPartial(); + } else { + fChild_ = value; + } + onChanged(); + } else { + fChildBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + public Builder clearFChild() { + if (fChildBuilder_ == null) { + fChild_ = null; + onChanged(); + } else { + fChild_ = null; + fChildBuilder_ = null; + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getFChildBuilder() { + + onChanged(); + return getFChildFieldBuilder().getBuilder(); + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null ? + com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : fChild_; + } + } + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + getFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getFChild(), + getParentForChildren(), + isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + /** + * optional string p_string = 17; + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string p_string = 17; + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string p_string = 17; + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString + getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string p_string = 17; + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + /** + * optional string p_string = 17; + * @return This builder for chaining. + */ + public Builder clearPString() { + bitField0_ = (bitField0_ & ~0x00000001); + pString_ = getDefaultInstance().getPString(); + onChanged(); + return this; + } + /** + * optional string p_string = 17; + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + + private int pInt32_ ; + /** + * optional int32 p_int32 = 18; + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional int32 p_int32 = 18; + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + /** + * optional int32 p_int32 = 18; + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + bitField0_ |= 0x00000002; + pInt32_ = value; + onChanged(); + return this; + } + /** + * optional int32 p_int32 = 18; + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00000002); + pInt32_ = 0; + onChanged(); + return this; + } + + private double pDouble_ ; + /** + * optional double p_double = 19; + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double p_double = 19; + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + /** + * optional double p_double = 19; + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + bitField0_ |= 0x00000004; + pDouble_ = value; + onChanged(); + return this; + } + /** + * optional double p_double = 19; + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000004); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_ ; + /** + * optional bool p_bool = 20; + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional bool p_bool = 20; + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + /** + * optional bool p_bool = 20; + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + bitField0_ |= 0x00000008; + pBool_ = value; + onChanged(); + return this; + } + /** + * optional bool p_bool = 20; + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00000008); + pBool_ = false; + onChanged(); + return this; + } + + private int pKingdom_ = 0; + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return Whether the pKingdom field is set. + */ + @java.lang.Override public boolean hasPKingdom() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override public int getPKingdomValue() { + return pKingdom_; + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @param value The enum numeric value on the wire for pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdomValue(int value) { + bitField0_ |= 0x00000010; + pKingdom_ = value; + onChanged(); + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(pKingdom_); + return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @param value The pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + pKingdom_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return This builder for chaining. + */ + public Builder clearPKingdom() { + bitField0_ = (bitField0_ & ~0x00000010); + pKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> pChildBuilder_; + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + onChanged(); + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + onChanged(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + pChild_ != null && + pChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { + pChild_ = + com.google.showcase.v1beta1.ComplianceDataChild.newBuilder(pChild_).mergeFrom(value).buildPartial(); + } else { + pChild_ = value; + } + onChanged(); + } else { + pChildBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + public Builder clearPChild() { + if (pChildBuilder_ == null) { + pChild_ = null; + onChanged(); + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getPChildBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getPChildFieldBuilder().getBuilder(); + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null ? + com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; + } + } + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + getPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getPChild(), + getParentForChildren(), + isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + @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.showcase.v1beta1.ComplianceData) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceData) + private static final com.google.showcase.v1beta1.ComplianceData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceData(); + } + + public static com.google.showcase.v1beta1.ComplianceData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceData(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.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java new file mode 100644 index 0000000000..0533611a6a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java @@ -0,0 +1,1766 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} + */ +public final class ComplianceDataChild extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataChild) + ComplianceDataChildOrBuilder { +private static final long serialVersionUID = 0L; + // Use ComplianceDataChild.newBuilder() to construct. + private ComplianceDataChild(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ComplianceDataChild() { + fString_ = ""; + fContinent_ = 0; + pString_ = ""; + pContinent_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ComplianceDataChild(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ComplianceDataChild( + 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(); + + fString_ = s; + break; + } + case 21: { + + fFloat_ = input.readFloat(); + break; + } + case 25: { + + fDouble_ = input.readDouble(); + break; + } + case 32: { + + fBool_ = input.readBool(); + break; + } + case 42: { + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder subBuilder = null; + if (fChild_ != null) { + subBuilder = fChild_.toBuilder(); + } + fChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataGrandchild.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fChild_); + fChild_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + pString_ = s; + break; + } + case 61: { + bitField0_ |= 0x00000002; + pFloat_ = input.readFloat(); + break; + } + case 65: { + bitField0_ |= 0x00000004; + pDouble_ = input.readDouble(); + break; + } + case 72: { + bitField0_ |= 0x00000008; + pBool_ = input.readBool(); + break; + } + case 82: { + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) != 0)) { + subBuilder = pChild_.toBuilder(); + } + pChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataGrandchild.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pChild_); + pChild_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 88: { + int rawValue = input.readEnum(); + + fContinent_ = rawValue; + break; + } + case 96: { + int rawValue = input.readEnum(); + + pContinent_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + private volatile java.lang.Object fString_; + /** + * string f_string = 1; + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + /** + * string f_string = 1; + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_FLOAT_FIELD_NUMBER = 2; + private float fFloat_; + /** + * float f_float = 2; + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 3; + private double fDouble_; + /** + * double f_double = 3; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 4; + private boolean fBool_; + /** + * bool f_bool = 4; + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_CONTINENT_FIELD_NUMBER = 11; + private int fContinent_; + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override public int getFContinentValue() { + return fContinent_; + } + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return The fContinent. + */ + @java.lang.Override public com.google.showcase.v1beta1.Continent getFContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 5; + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return fChild_ != null; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : fChild_; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + return getFChild(); + } + + public static final int P_STRING_FIELD_NUMBER = 6; + private volatile java.lang.Object pString_; + /** + * optional string p_string = 6; + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string p_string = 6; + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + /** + * optional string p_string = 6; + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_FLOAT_FIELD_NUMBER = 7; + private float pFloat_; + /** + * optional float p_float = 7; + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional float p_float = 7; + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 8; + private double pDouble_; + /** + * optional double p_double = 8; + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double p_double = 8; + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 9; + private boolean pBool_; + /** + * optional bool p_bool = 9; + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional bool p_bool = 9; + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_CONTINENT_FIELD_NUMBER = 12; + private int pContinent_; + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override public int getPContinentValue() { + return pContinent_; + } + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return The pContinent. + */ + @java.lang.Override public com.google.showcase.v1beta1.Continent getPContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 10; + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(3, fDouble_); + } + if (fBool_ != false) { + output.writeBool(4, fBool_); + } + if (fChild_ != null) { + output.writeMessage(5, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeFloat(7, pFloat_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(8, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(9, pBool_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(12, pContinent_); + } + 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(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, fBool_); + } + if (fChild_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, pFloat_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(8, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, pBool_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(12, pContinent_); + } + 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.showcase.v1beta1.ComplianceDataChild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataChild other = (com.google.showcase.v1beta1.ComplianceDataChild) obj; + + if (!getFString() + .equals(other.getFString())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits( + other.getFFloat())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits( + other.getFDouble())) return false; + if (getFBool() + != other.getFBool()) return false; + if (fContinent_ != other.fContinent_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild() + .equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString() + .equals(other.getPString())) return false; + } + if (hasPFloat() != other.hasPFloat()) return false; + if (hasPFloat()) { + if (java.lang.Float.floatToIntBits(getPFloat()) + != java.lang.Float.floatToIntBits( + other.getPFloat())) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits( + other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() + != other.getPBool()) return false; + } + if (pContinent_ != other.pContinent_) return false; + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild() + .equals(other.getPChild())) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFFloat()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFBool()); + hash = (37 * hash) + F_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + fContinent_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPFloat()) { + hash = (37 * hash) + P_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPFloat()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPBool()); + } + hash = (37 * hash) + P_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + pContinent_; + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataChild) + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataChild.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPChildFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + fString_ = ""; + + fFloat_ = 0F; + + fDouble_ = 0D; + + fBool_ = false; + + fContinent_ = 0; + + if (fChildBuilder_ == null) { + fChild_ = null; + } else { + fChild_ = null; + fChildBuilder_ = null; + } + pString_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + pFloat_ = 0F; + bitField0_ = (bitField0_ & ~0x00000002); + pDouble_ = 0D; + bitField0_ = (bitField0_ & ~0x00000004); + pBool_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + pContinent_ = 0; + + if (pChildBuilder_ == null) { + pChild_ = null; + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild build() { + com.google.showcase.v1beta1.ComplianceDataChild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataChild result = new com.google.showcase.v1beta1.ComplianceDataChild(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.fString_ = fString_; + result.fFloat_ = fFloat_; + result.fDouble_ = fDouble_; + result.fBool_ = fBool_; + result.fContinent_ = fContinent_; + if (fChildBuilder_ == null) { + result.fChild_ = fChild_; + } else { + result.fChild_ = fChildBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.pString_ = pString_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pFloat_ = pFloat_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000008; + } + result.pContinent_ = pContinent_; + if (((from_bitField0_ & 0x00000010) != 0)) { + if (pChildBuilder_ == null) { + result.pChild_ = pChild_; + } else { + result.pChild_ = pChildBuilder_.build(); + } + to_bitField0_ |= 0x00000010; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.ComplianceDataChild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataChild)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataChild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + onChanged(); + } + if (other.getFFloat() != 0F) { + setFFloat(other.getFFloat()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.fContinent_ != 0) { + setFContinentValue(other.getFContinentValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + bitField0_ |= 0x00000001; + pString_ = other.pString_; + onChanged(); + } + if (other.hasPFloat()) { + setPFloat(other.getPFloat()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.pContinent_ != 0) { + setPContinentValue(other.getPContinentValue()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + 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.showcase.v1beta1.ComplianceDataChild parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceDataChild) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object fString_ = ""; + /** + * string f_string = 1; + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string f_string = 1; + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString + getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string f_string = 1; + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fString_ = value; + onChanged(); + return this; + } + /** + * string f_string = 1; + * @return This builder for chaining. + */ + public Builder clearFString() { + + fString_ = getDefaultInstance().getFString(); + onChanged(); + return this; + } + /** + * string f_string = 1; + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fString_ = value; + onChanged(); + return this; + } + + private float fFloat_ ; + /** + * float f_float = 2; + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + /** + * float f_float = 2; + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + onChanged(); + return this; + } + /** + * float f_float = 2; + * @return This builder for chaining. + */ + public Builder clearFFloat() { + + fFloat_ = 0F; + onChanged(); + return this; + } + + private double fDouble_ ; + /** + * double f_double = 3; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + /** + * double f_double = 3; + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + /** + * double f_double = 3; + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_ ; + /** + * bool f_bool = 4; + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + /** + * bool f_bool = 4; + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + onChanged(); + return this; + } + /** + * bool f_bool = 4; + * @return This builder for chaining. + */ + public Builder clearFBool() { + + fBool_ = false; + onChanged(); + return this; + } + + private int fContinent_ = 0; + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override public int getFContinentValue() { + return fContinent_; + } + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @param value The enum numeric value on the wire for fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinentValue(int value) { + + fContinent_ = value; + onChanged(); + return this; + } + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @param value The fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + + fContinent_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return This builder for chaining. + */ + public Builder clearFContinent() { + + fContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> fChildBuilder_; + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return fChildBuilder_ != null || fChild_ != null; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + onChanged(); + } else { + fChildBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + onChanged(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (fChild_ != null) { + fChild_ = + com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder(fChild_).mergeFrom(value).buildPartial(); + } else { + fChild_ = value; + } + onChanged(); + } else { + fChildBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + public Builder clearFChild() { + if (fChildBuilder_ == null) { + fChild_ = null; + onChanged(); + } else { + fChild_ = null; + fChildBuilder_ = null; + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getFChildBuilder() { + + onChanged(); + return getFChildFieldBuilder().getBuilder(); + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null ? + com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : fChild_; + } + } + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + getFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getFChild(), + getParentForChildren(), + isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + /** + * optional string p_string = 6; + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string p_string = 6; + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string p_string = 6; + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString + getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string p_string = 6; + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + /** + * optional string p_string = 6; + * @return This builder for chaining. + */ + public Builder clearPString() { + bitField0_ = (bitField0_ & ~0x00000001); + pString_ = getDefaultInstance().getPString(); + onChanged(); + return this; + } + /** + * optional string p_string = 6; + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + + private float pFloat_ ; + /** + * optional float p_float = 7; + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional float p_float = 7; + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + /** + * optional float p_float = 7; + * @param value The pFloat to set. + * @return This builder for chaining. + */ + public Builder setPFloat(float value) { + bitField0_ |= 0x00000002; + pFloat_ = value; + onChanged(); + return this; + } + /** + * optional float p_float = 7; + * @return This builder for chaining. + */ + public Builder clearPFloat() { + bitField0_ = (bitField0_ & ~0x00000002); + pFloat_ = 0F; + onChanged(); + return this; + } + + private double pDouble_ ; + /** + * optional double p_double = 8; + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double p_double = 8; + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + /** + * optional double p_double = 8; + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + bitField0_ |= 0x00000004; + pDouble_ = value; + onChanged(); + return this; + } + /** + * optional double p_double = 8; + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000004); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_ ; + /** + * optional bool p_bool = 9; + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional bool p_bool = 9; + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + /** + * optional bool p_bool = 9; + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + bitField0_ |= 0x00000008; + pBool_ = value; + onChanged(); + return this; + } + /** + * optional bool p_bool = 9; + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00000008); + pBool_ = false; + onChanged(); + return this; + } + + private int pContinent_ = 0; + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override public int getPContinentValue() { + return pContinent_; + } + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @param value The enum numeric value on the wire for pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinentValue(int value) { + + pContinent_ = value; + onChanged(); + return this; + } + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @param value The pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + + pContinent_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return This builder for chaining. + */ + public Builder clearPContinent() { + + pContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> pChildBuilder_; + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + onChanged(); + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + onChanged(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + pChild_ != null && + pChild_ != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { + pChild_ = + com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder(pChild_).mergeFrom(value).buildPartial(); + } else { + pChild_ = value; + } + onChanged(); + } else { + pChildBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + public Builder clearPChild() { + if (pChildBuilder_ == null) { + pChild_ = null; + onChanged(); + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getPChildBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getPChildFieldBuilder().getBuilder(); + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null ? + com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; + } + } + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + getPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getPChild(), + getParentForChildren(), + isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + @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.showcase.v1beta1.ComplianceDataChild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataChild) + private static final com.google.showcase.v1beta1.ComplianceDataChild DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataChild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataChild parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceDataChild(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.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java new file mode 100644 index 0000000000..d5b30a7ccc --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java @@ -0,0 +1,141 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceDataChildOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataChild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * @return The fString. + */ + java.lang.String getFString(); + /** + * string f_string = 1; + * @return The bytes for fString. + */ + com.google.protobuf.ByteString + getFStringBytes(); + + /** + * float f_float = 2; + * @return The fFloat. + */ + float getFFloat(); + + /** + * double f_double = 3; + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 4; + * @return The fBool. + */ + boolean getFBool(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return The enum numeric value on the wire for fContinent. + */ + int getFContinentValue(); + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * @return The fContinent. + */ + com.google.showcase.v1beta1.Continent getFContinent(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild(); + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 6; + * @return Whether the pString field is set. + */ + boolean hasPString(); + /** + * optional string p_string = 6; + * @return The pString. + */ + java.lang.String getPString(); + /** + * optional string p_string = 6; + * @return The bytes for pString. + */ + com.google.protobuf.ByteString + getPStringBytes(); + + /** + * optional float p_float = 7; + * @return Whether the pFloat field is set. + */ + boolean hasPFloat(); + /** + * optional float p_float = 7; + * @return The pFloat. + */ + float getPFloat(); + + /** + * optional double p_double = 8; + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + /** + * optional double p_double = 8; + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 9; + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + /** + * optional bool p_bool = 9; + * @return The pBool. + */ + boolean getPBool(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return The enum numeric value on the wire for pContinent. + */ + int getPContinentValue(); + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * @return The pContinent. + */ + com.google.showcase.v1beta1.Continent getPContinent(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild(); + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java new file mode 100644 index 0000000000..87d2d1ab6c --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java @@ -0,0 +1,690 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} + */ +public final class ComplianceDataGrandchild extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + ComplianceDataGrandchildOrBuilder { +private static final long serialVersionUID = 0L; + // Use ComplianceDataGrandchild.newBuilder() to construct. + private ComplianceDataGrandchild(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ComplianceDataGrandchild() { + fString_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ComplianceDataGrandchild(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ComplianceDataGrandchild( + 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(); + + fString_ = s; + break; + } + case 17: { + + fDouble_ = input.readDouble(); + break; + } + case 24: { + + fBool_ = 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.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + public static final int F_STRING_FIELD_NUMBER = 1; + private volatile java.lang.Object fString_; + /** + * string f_string = 1; + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + /** + * string f_string = 1; + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_DOUBLE_FIELD_NUMBER = 2; + private double fDouble_; + /** + * double f_double = 2; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 3; + private boolean fBool_; + /** + * bool f_bool = 3; + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(2, fDouble_); + } + if (fBool_ != false) { + output.writeBool(3, fBool_); + } + 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(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, fBool_); + } + 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.showcase.v1beta1.ComplianceDataGrandchild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataGrandchild other = (com.google.showcase.v1beta1.ComplianceDataGrandchild) obj; + + if (!getFString() + .equals(other.getFString())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits( + other.getFDouble())) return false; + if (getFBool() + != other.getFBool()) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFBool()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataGrandchild.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(); + fString_ = ""; + + fDouble_ = 0D; + + fBool_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild build() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = new com.google.showcase.v1beta1.ComplianceDataGrandchild(this); + result.fString_ = fString_; + result.fDouble_ = fDouble_; + result.fBool_ = fBool_; + 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.showcase.v1beta1.ComplianceDataGrandchild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataGrandchild)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataGrandchild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + onChanged(); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + 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.showcase.v1beta1.ComplianceDataGrandchild parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceDataGrandchild) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object fString_ = ""; + /** + * string f_string = 1; + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string f_string = 1; + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString + getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string f_string = 1; + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fString_ = value; + onChanged(); + return this; + } + /** + * string f_string = 1; + * @return This builder for chaining. + */ + public Builder clearFString() { + + fString_ = getDefaultInstance().getFString(); + onChanged(); + return this; + } + /** + * string f_string = 1; + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fString_ = value; + onChanged(); + return this; + } + + private double fDouble_ ; + /** + * double f_double = 2; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + /** + * double f_double = 2; + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + /** + * double f_double = 2; + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_ ; + /** + * bool f_bool = 3; + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + /** + * bool f_bool = 3; + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + onChanged(); + return this; + } + /** + * bool f_bool = 3; + * @return This builder for chaining. + */ + public Builder clearFBool() { + + fBool_ = 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.showcase.v1beta1.ComplianceDataGrandchild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataGrandchild) + private static final com.google.showcase.v1beta1.ComplianceDataGrandchild DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataGrandchild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataGrandchild parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceDataGrandchild(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.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java new file mode 100644 index 0000000000..a18fa786f0 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceDataGrandchildOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * @return The fString. + */ + java.lang.String getFString(); + /** + * string f_string = 1; + * @return The bytes for fString. + */ + com.google.protobuf.ByteString + getFStringBytes(); + + /** + * double f_double = 2; + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 3; + * @return The fBool. + */ + boolean getFBool(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java new file mode 100644 index 0000000000..82dfdf52ab --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java @@ -0,0 +1,212 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceData) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * @return The fString. + */ + java.lang.String getFString(); + /** + * string f_string = 1; + * @return The bytes for fString. + */ + com.google.protobuf.ByteString + getFStringBytes(); + + /** + * int32 f_int32 = 2; + * @return The fInt32. + */ + int getFInt32(); + + /** + * sint32 f_sint32 = 3; + * @return The fSint32. + */ + int getFSint32(); + + /** + * sfixed32 f_sfixed32 = 4; + * @return The fSfixed32. + */ + int getFSfixed32(); + + /** + * uint32 f_uint32 = 5; + * @return The fUint32. + */ + int getFUint32(); + + /** + * fixed32 f_fixed32 = 6; + * @return The fFixed32. + */ + int getFFixed32(); + + /** + * int64 f_int64 = 7; + * @return The fInt64. + */ + long getFInt64(); + + /** + * sint64 f_sint64 = 8; + * @return The fSint64. + */ + long getFSint64(); + + /** + * sfixed64 f_sfixed64 = 9; + * @return The fSfixed64. + */ + long getFSfixed64(); + + /** + * uint64 f_uint64 = 10; + * @return The fUint64. + */ + long getFUint64(); + + /** + * fixed64 f_fixed64 = 11; + * @return The fFixed64. + */ + long getFFixed64(); + + /** + * double f_double = 12; + * @return The fDouble. + */ + double getFDouble(); + + /** + * float f_float = 13; + * @return The fFloat. + */ + float getFFloat(); + + /** + * bool f_bool = 14; + * @return The fBool. + */ + boolean getFBool(); + + /** + * bytes f_bytes = 15; + * @return The fBytes. + */ + com.google.protobuf.ByteString getFBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return The enum numeric value on the wire for fKingdom. + */ + int getFKingdomValue(); + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * @return The fKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getFChild(); + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 17; + * @return Whether the pString field is set. + */ + boolean hasPString(); + /** + * optional string p_string = 17; + * @return The pString. + */ + java.lang.String getPString(); + /** + * optional string p_string = 17; + * @return The bytes for pString. + */ + com.google.protobuf.ByteString + getPStringBytes(); + + /** + * optional int32 p_int32 = 18; + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + /** + * optional int32 p_int32 = 18; + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional double p_double = 19; + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + /** + * optional double p_double = 19; + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 20; + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + /** + * optional bool p_bool = 20; + * @return The pBool. + */ + boolean getPBool(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return Whether the pKingdom field is set. + */ + boolean hasPKingdom(); + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return The enum numeric value on the wire for pKingdom. + */ + int getPKingdomValue(); + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * @return The pKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getPChild(); + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java new file mode 100644 index 0000000000..05bf124570 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java @@ -0,0 +1,1114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * ComplianceGroups encapsulates a group of RPC requests to the Compliance
+ * server: one request for each combination of elements of `rpcs` and of
+ * `requests`.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ +public final class ComplianceGroup extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceGroup) + ComplianceGroupOrBuilder { +private static final long serialVersionUID = 0L; + // Use ComplianceGroup.newBuilder() to construct. + private ComplianceGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ComplianceGroup() { + name_ = ""; + rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ComplianceGroup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ComplianceGroup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + rpcs_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rpcs_.add(s); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + requests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + requests_.add( + input.readMessage(com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rpcs_ = rpcs_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * string name = 1; + * @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; + } + } + /** + * string name = 1; + * @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 RPCS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList rpcs_; + /** + * repeated string rpcs = 2; + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList + getRpcsList() { + return rpcs_; + } + /** + * repeated string rpcs = 2; + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + /** + * repeated string rpcs = 2; + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + /** + * repeated string rpcs = 2; + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString + getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + public static final int REQUESTS_FIELD_NUMBER = 3; + private java.util.List requests_; + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + @java.lang.Override + public java.util.List getRequestsList() { + return requests_; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + @java.lang.Override + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + @java.lang.Override + public int getRequestsCount() { + return requests_.size(); + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + return requests_.get(index); + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < rpcs_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rpcs_.getRaw(i)); + } + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(3, requests_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < rpcs_.size(); i++) { + dataSize += computeStringSizeNoTag(rpcs_.getRaw(i)); + } + size += dataSize; + size += 1 * getRpcsList().size(); + } + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, requests_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceGroup)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceGroup other = (com.google.showcase.v1beta1.ComplianceGroup) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getRpcsList() + .equals(other.getRpcsList())) return false; + if (!getRequestsList() + .equals(other.getRequestsList())) 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 (getRpcsCount() > 0) { + hash = (37 * hash) + RPCS_FIELD_NUMBER; + hash = (53 * hash) + getRpcsList().hashCode(); + } + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup 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; + } + /** + *
+   * ComplianceGroups encapsulates a group of RPC requests to the Compliance
+   * server: one request for each combination of elements of `rpcs` and of
+   * `requests`.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceGroup) + com.google.showcase.v1beta1.ComplianceGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceGroup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRequestsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + requestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup build() { + com.google.showcase.v1beta1.ComplianceGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup buildPartial() { + com.google.showcase.v1beta1.ComplianceGroup result = new com.google.showcase.v1beta1.ComplianceGroup(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (((bitField0_ & 0x00000001) != 0)) { + rpcs_ = rpcs_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rpcs_ = rpcs_; + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceGroup) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceGroup)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceGroup other) { + if (other == com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.rpcs_.isEmpty()) { + if (rpcs_.isEmpty()) { + rpcs_ = other.rpcs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRpcsIsMutable(); + rpcs_.addAll(other.rpcs_); + } + onChanged(); + } + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000002); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRequestsFieldBuilder() : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + 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.showcase.v1beta1.ComplianceGroup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceGroup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @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; + } + } + /** + * string name = 1; + * @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; + } + } + /** + * string name = 1; + * @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; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 1; + * @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.LazyStringList rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureRpcsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rpcs_ = new com.google.protobuf.LazyStringArrayList(rpcs_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated string rpcs = 2; + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList + getRpcsList() { + return rpcs_.getUnmodifiableView(); + } + /** + * repeated string rpcs = 2; + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + /** + * repeated string rpcs = 2; + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + /** + * repeated string rpcs = 2; + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString + getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + /** + * repeated string rpcs = 2; + * @param index The index to set the value at. + * @param value The rpcs to set. + * @return This builder for chaining. + */ + public Builder setRpcs( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.set(index, value); + onChanged(); + return this; + } + /** + * repeated string rpcs = 2; + * @param value The rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcs( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.add(value); + onChanged(); + return this; + } + /** + * repeated string rpcs = 2; + * @param values The rpcs to add. + * @return This builder for chaining. + */ + public Builder addAllRpcs( + java.lang.Iterable values) { + ensureRpcsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, rpcs_); + onChanged(); + return this; + } + /** + * repeated string rpcs = 2; + * @return This builder for chaining. + */ + public Builder clearRpcs() { + rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated string rpcs = 2; + * @param value The bytes of the rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRpcsIsMutable(); + rpcs_.add(value); + onChanged(); + return this; + } + + private java.util.List requests_ = + java.util.Collections.emptyList(); + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + requests_ = new java.util.ArrayList(requests_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> requestsBuilder_; + + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder setRequests( + int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder setRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder addRequests( + int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder addRequests( + com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder addRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder addAllRequests( + java.lang.Iterable values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder( + int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + requests_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + requests_ = null; + } + return requestsBuilder_; + } + @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.showcase.v1beta1.ComplianceGroup) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceGroup) + private static final com.google.showcase.v1beta1.ComplianceGroup DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceGroup(); + } + + public static com.google.showcase.v1beta1.ComplianceGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceGroup(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.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java new file mode 100644 index 0000000000..71970f5bda --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceGroupOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * repeated string rpcs = 2; + * @return A list containing the rpcs. + */ + java.util.List + getRpcsList(); + /** + * repeated string rpcs = 2; + * @return The count of rpcs. + */ + int getRpcsCount(); + /** + * repeated string rpcs = 2; + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + java.lang.String getRpcs(int index); + /** + * repeated string rpcs = 2; + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + com.google.protobuf.ByteString + getRpcsBytes(int index); + + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + java.util.List + getRequestsList(); + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + com.google.showcase.v1beta1.RepeatRequest getRequests(int index); + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + int getRequestsCount(); + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + java.util.List + getRequestsOrBuilderList(); + /** + * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; + */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder( + int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java new file mode 100644 index 0000000000..a1cb63ee80 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java @@ -0,0 +1,252 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public final class ComplianceOuterClass { + private ComplianceOuterClass() {} + 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_showcase_v1beta1_RepeatRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n/schema/google/showcase/v1beta1/complia" + + "nce.proto\022\027google.showcase.v1beta1\032\034goog" + + "le/api/annotations.proto\032\027google/api/cli" + + "ent.proto\"\303\002\n\rRepeatRequest\022\014\n\004name\030\001 \001(" + + "\t\0225\n\004info\030\002 \001(\0132\'.google.showcase.v1beta" + + "1.ComplianceData\022\025\n\rserver_verify\030\003 \001(\010\022" + + "!\n\024intended_binding_uri\030\n \001(\tH\000\210\001\001\022\017\n\007f_" + + "int32\030\004 \001(\005\022\017\n\007f_int64\030\005 \001(\003\022\020\n\010f_double" + + "\030\006 \001(\001\022\024\n\007p_int32\030\007 \001(\005H\001\210\001\001\022\024\n\007p_int64\030" + + "\010 \001(\003H\002\210\001\001\022\025\n\010p_double\030\t \001(\001H\003\210\001\001B\027\n\025_in" + + "tended_binding_uriB\n\n\010_p_int32B\n\n\010_p_int" + + "64B\013\n\t_p_double\"^\n\016RepeatResponse\0227\n\007req" + + "uest\030\001 \001(\0132&.google.showcase.v1beta1.Rep" + + "eatRequest\022\023\n\013binding_uri\030\002 \001(\t\"J\n\017Compl" + + "ianceSuite\0227\n\005group\030\001 \003(\0132(.google.showc" + + "ase.v1beta1.ComplianceGroup\"g\n\017Complianc" + + "eGroup\022\014\n\004name\030\001 \001(\t\022\014\n\004rpcs\030\002 \003(\t\0228\n\010re" + + "quests\030\003 \003(\0132&.google.showcase.v1beta1.R" + + "epeatRequest\"\340\006\n\016ComplianceData\022\020\n\010f_str" + + "ing\030\001 \001(\t\022\017\n\007f_int32\030\002 \001(\005\022\020\n\010f_sint32\030\003" + + " \001(\021\022\022\n\nf_sfixed32\030\004 \001(\017\022\020\n\010f_uint32\030\005 \001" + + "(\r\022\021\n\tf_fixed32\030\006 \001(\007\022\017\n\007f_int64\030\007 \001(\003\022\020" + + "\n\010f_sint64\030\010 \001(\022\022\022\n\nf_sfixed64\030\t \001(\020\022\020\n\010" + + "f_uint64\030\n \001(\004\022\021\n\tf_fixed64\030\013 \001(\006\022\020\n\010f_d" + + "ouble\030\014 \001(\001\022\017\n\007f_float\030\r \001(\002\022\016\n\006f_bool\030\016" + + " \001(\010\022\017\n\007f_bytes\030\017 \001(\014\022F\n\tf_kingdom\030\026 \001(\016" + + "23.google.showcase.v1beta1.ComplianceDat" + + "a.LifeKingdom\022=\n\007f_child\030\020 \001(\0132,.google." + + "showcase.v1beta1.ComplianceDataChild\022\025\n\010" + + "p_string\030\021 \001(\tH\000\210\001\001\022\024\n\007p_int32\030\022 \001(\005H\001\210\001" + + "\001\022\025\n\010p_double\030\023 \001(\001H\002\210\001\001\022\023\n\006p_bool\030\024 \001(\010" + + "H\003\210\001\001\022K\n\tp_kingdom\030\027 \001(\01623.google.showca" + + "se.v1beta1.ComplianceData.LifeKingdomH\004\210" + + "\001\001\022B\n\007p_child\030\025 \001(\0132,.google.showcase.v1" + + "beta1.ComplianceDataChildH\005\210\001\001\"\203\001\n\013LifeK" + + "ingdom\022\034\n\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n\016" + + "ARCHAEBACTERIA\020\001\022\016\n\nEUBACTERIA\020\002\022\014\n\010PROT" + + "ISTA\020\003\022\t\n\005FUNGI\020\004\022\013\n\007PLANTAE\020\005\022\014\n\010ANIMAL" + + "IA\020\006B\013\n\t_p_stringB\n\n\010_p_int32B\013\n\t_p_doub" + + "leB\t\n\007_p_boolB\014\n\n_p_kingdomB\n\n\010_p_child\"" + + "\357\003\n\023ComplianceDataChild\022\020\n\010f_string\030\001 \001(" + + "\t\022\017\n\007f_float\030\002 \001(\002\022\020\n\010f_double\030\003 \001(\001\022\016\n\006" + + "f_bool\030\004 \001(\010\0227\n\013f_continent\030\013 \001(\0162\".goog" + + "le.showcase.v1beta1.Continent\022B\n\007f_child" + + "\030\005 \001(\01321.google.showcase.v1beta1.Complia" + + "nceDataGrandchild\022\025\n\010p_string\030\006 \001(\tH\000\210\001\001" + + "\022\024\n\007p_float\030\007 \001(\002H\001\210\001\001\022\025\n\010p_double\030\010 \001(\001" + + "H\002\210\001\001\022\023\n\006p_bool\030\t \001(\010H\003\210\001\001\0227\n\013p_continen" + + "t\030\014 \001(\0162\".google.showcase.v1beta1.Contin" + + "ent\022G\n\007p_child\030\n \001(\01321.google.showcase.v" + + "1beta1.ComplianceDataGrandchildH\004\210\001\001B\013\n\t" + + "_p_stringB\n\n\010_p_floatB\013\n\t_p_doubleB\t\n\007_p" + + "_boolB\n\n\010_p_child\"N\n\030ComplianceDataGrand" + + "child\022\020\n\010f_string\030\001 \001(\t\022\020\n\010f_double\030\002 \001(" + + "\001\022\016\n\006f_bool\030\003 \001(\010\"#\n\013EnumRequest\022\024\n\014unkn" + + "own_enum\030\001 \001(\010\"|\n\014EnumResponse\0225\n\007reques" + + "t\030\001 \001(\0132$.google.showcase.v1beta1.EnumRe" + + "quest\0225\n\tcontinent\030\002 \001(\0162\".google.showca" + + "se.v1beta1.Continent*i\n\tContinent\022\031\n\025CON" + + "TINENT_UNSPECIFIED\020\000\022\n\n\006AFRICA\020\001\022\013\n\007AMER" + + "ICA\020\002\022\r\n\tANTARTICA\020\003\022\r\n\tAUSTRALIA\020\004\022\n\n\006E" + + "UROPE\020\0052\330\r\n\nCompliance\022\202\001\n\016RepeatDataBod" + + "y\022&.google.showcase.v1beta1.RepeatReques" + + "t\032\'.google.showcase.v1beta1.RepeatRespon" + + "se\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n\022" + + "RepeatDataBodyInfo\022&.google.showcase.v1b" + + "eta1.RepeatRequest\032\'.google.showcase.v1b" + + "eta1.RepeatResponse\"&\202\323\344\223\002 \"\030/v1beta1/re" + + "peat:bodyinfo:\004info\022\201\001\n\017RepeatDataQuery\022" + + "&.google.showcase.v1beta1.RepeatRequest\032" + + "\'.google.showcase.v1beta1.RepeatResponse" + + "\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n\024Repe" + + "atDataSimplePath\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"p\202\323\344\223\002j\022h/v1beta1/repe" + + "at/{info.f_string}/{info.f_int32}/{info." + + "f_double}/{info.f_bool}/{info.f_kingdom}" + + ":simplepath\022\323\002\n\026RepeatDataPathResource\022&" + + ".google.showcase.v1beta1.RepeatRequest\032\'" + + ".google.showcase.v1beta1.RepeatResponse\"" + + "\347\001\202\323\344\223\002\340\001\022h/v1beta1/repeat/{info.f_strin" + + "g=first/*}/{info.f_child.f_string=second" + + "/*}/bool/{info.f_bool}:pathresourceZt\022r/" + + "v1beta1/repeat/{info.f_child.f_string=fi" + + "rst/*}/{info.f_string=second/*}/bool/{in" + + "fo.f_bool}:childfirstpathresource\022\331\001\n\036Re" + + "peatDataPathTrailingResource\022&.google.sh" + + "owcase.v1beta1.RepeatRequest\032\'.google.sh" + + "owcase.v1beta1.RepeatResponse\"f\202\323\344\223\002`\022^/" + + "v1beta1/repeat/{info.f_string=first/*}/{" + + "info.f_child.f_string=second/**}:pathtra" + + "ilingresource\022\210\001\n\021RepeatDataBodyPut\022&.go" + + "ogle.showcase.v1beta1.RepeatRequest\032\'.go" + + "ogle.showcase.v1beta1.RepeatResponse\"\"\202\323" + + "\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n\023Rep" + + "eatDataBodyPatch\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repe" + + "at:bodypatch:\001*\022x\n\007GetEnum\022$.google.show" + + "case.v1beta1.EnumRequest\032%.google.showca" + + "se.v1beta1.EnumResponse\" \202\323\344\223\002\032\022\030/v1beta" + + "1/compliance/enum\022|\n\nVerifyEnum\022%.google" + + ".showcase.v1beta1.EnumResponse\032%.google." + + "showcase.v1beta1.EnumResponse\" \202\323\344\223\002\032\"\030/" + + "v1beta1/compliance/enum\032\021\312A\016localhost:74" + + "69Bq\n\033com.google.showcase.v1beta1P\001Z4git" + + "hub.com/googleapis/gapic-showcase/server" + + "/genproto\352\002\031Google::Showcase::V1beta1b\006p" + + "roto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor, + new java.lang.String[] { "Name", "Info", "ServerVerify", "IntendedBindingUri", "FInt32", "FInt64", "FDouble", "PInt32", "PInt64", "PDouble", "IntendedBindingUri", "PInt32", "PInt64", "PDouble", }); + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor, + new java.lang.String[] { "Request", "BindingUri", }); + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor, + new java.lang.String[] { "Group", }); + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor, + new java.lang.String[] { "Name", "Rpcs", "Requests", }); + internal_static_google_showcase_v1beta1_ComplianceData_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceData_descriptor, + new java.lang.String[] { "FString", "FInt32", "FSint32", "FSfixed32", "FUint32", "FFixed32", "FInt64", "FSint64", "FSfixed64", "FUint64", "FFixed64", "FDouble", "FFloat", "FBool", "FBytes", "FKingdom", "FChild", "PString", "PInt32", "PDouble", "PBool", "PKingdom", "PChild", "PString", "PInt32", "PDouble", "PBool", "PKingdom", "PChild", }); + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor, + new java.lang.String[] { "FString", "FFloat", "FDouble", "FBool", "FContinent", "FChild", "PString", "PFloat", "PDouble", "PBool", "PContinent", "PChild", "PString", "PFloat", "PDouble", "PBool", "PChild", }); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor, + new java.lang.String[] { "FString", "FDouble", "FBool", }); + internal_static_google_showcase_v1beta1_EnumRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumRequest_descriptor, + new java.lang.String[] { "UnknownEnum", }); + internal_static_google_showcase_v1beta1_EnumResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumResponse_descriptor, + new java.lang.String[] { "Request", "Continent", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java new file mode 100644 index 0000000000..e87565b059 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java @@ -0,0 +1,784 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * ComplianceSuite contains a set of requests that microgenerators should issue
+ * over REST to the Compliance service to test their gRPC-to-REST transcoding
+ * implementation.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ +public final class ComplianceSuite extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceSuite) + ComplianceSuiteOrBuilder { +private static final long serialVersionUID = 0L; + // Use ComplianceSuite.newBuilder() to construct. + private ComplianceSuite(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ComplianceSuite() { + group_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ComplianceSuite(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ComplianceSuite( + 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)) { + group_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + group_.add( + input.readMessage(com.google.showcase.v1beta1.ComplianceGroup.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + public static final int GROUP_FIELD_NUMBER = 1; + private java.util.List group_; + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + @java.lang.Override + public java.util.List getGroupList() { + return group_; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + @java.lang.Override + public java.util.List + getGroupOrBuilderList() { + return group_; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + @java.lang.Override + public int getGroupCount() { + return group_.size(); + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + return group_.get(index); + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder( + int index) { + return group_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < group_.size(); i++) { + output.writeMessage(1, group_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < group_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, group_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceSuite)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceSuite other = (com.google.showcase.v1beta1.ComplianceSuite) obj; + + if (!getGroupList() + .equals(other.getGroupList())) 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 (getGroupCount() > 0) { + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroupList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite 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; + } + /** + *
+   * ComplianceSuite contains a set of requests that microgenerators should issue
+   * over REST to the Compliance service to test their gRPC-to-REST transcoding
+   * implementation.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceSuite) + com.google.showcase.v1beta1.ComplianceSuiteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceSuite.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getGroupFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite build() { + com.google.showcase.v1beta1.ComplianceSuite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite buildPartial() { + com.google.showcase.v1beta1.ComplianceSuite result = new com.google.showcase.v1beta1.ComplianceSuite(this); + int from_bitField0_ = bitField0_; + if (groupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.group_ = group_; + } else { + result.group_ = groupBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceSuite) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceSuite)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceSuite other) { + if (other == com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance()) return this; + if (groupBuilder_ == null) { + if (!other.group_.isEmpty()) { + if (group_.isEmpty()) { + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupIsMutable(); + group_.addAll(other.group_); + } + onChanged(); + } + } else { + if (!other.group_.isEmpty()) { + if (groupBuilder_.isEmpty()) { + groupBuilder_.dispose(); + groupBuilder_ = null; + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + groupBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getGroupFieldBuilder() : null; + } else { + groupBuilder_.addAllMessages(other.group_); + } + } + } + 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.showcase.v1beta1.ComplianceSuite parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceSuite) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List group_ = + java.util.Collections.emptyList(); + private void ensureGroupIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + group_ = new java.util.ArrayList(group_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, com.google.showcase.v1beta1.ComplianceGroup.Builder, com.google.showcase.v1beta1.ComplianceGroupOrBuilder> groupBuilder_; + + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public java.util.List getGroupList() { + if (groupBuilder_ == null) { + return java.util.Collections.unmodifiableList(group_); + } else { + return groupBuilder_.getMessageList(); + } + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public int getGroupCount() { + if (groupBuilder_ == null) { + return group_.size(); + } else { + return groupBuilder_.getCount(); + } + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessage(index); + } + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder setGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.set(index, value); + onChanged(); + } else { + groupBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder setGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.set(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(value); + onChanged(); + } else { + groupBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder addGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(index, value); + onChanged(); + } else { + groupBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder addGroup( + com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder addGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder addAllGroup( + java.lang.Iterable values) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, group_); + onChanged(); + } else { + groupBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder clearGroup() { + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupBuilder_.clear(); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public Builder removeGroup(int index) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.remove(index); + onChanged(); + } else { + groupBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder getGroupBuilder( + int index) { + return getGroupFieldBuilder().getBuilder(index); + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder( + int index) { + if (groupBuilder_ == null) { + return group_.get(index); } else { + return groupBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public java.util.List + getGroupOrBuilderList() { + if (groupBuilder_ != null) { + return groupBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(group_); + } + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder() { + return getGroupFieldBuilder().addBuilder( + com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder( + int index) { + return getGroupFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + public java.util.List + getGroupBuilderList() { + return getGroupFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, com.google.showcase.v1beta1.ComplianceGroup.Builder, com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + getGroupFieldBuilder() { + if (groupBuilder_ == null) { + groupBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, com.google.showcase.v1beta1.ComplianceGroup.Builder, com.google.showcase.v1beta1.ComplianceGroupOrBuilder>( + group_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + group_ = null; + } + return groupBuilder_; + } + @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.showcase.v1beta1.ComplianceSuite) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceSuite) + private static final com.google.showcase.v1beta1.ComplianceSuite DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceSuite(); + } + + public static com.google.showcase.v1beta1.ComplianceSuite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceSuite parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceSuite(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.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java new file mode 100644 index 0000000000..01f718e845 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceSuiteOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceSuite) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + java.util.List + getGroupList(); + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + com.google.showcase.v1beta1.ComplianceGroup getGroup(int index); + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + int getGroupCount(); + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + java.util.List + getGroupOrBuilderList(); + /** + * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; + */ + com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder( + int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java new file mode 100644 index 0000000000..ee58d0f26a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java @@ -0,0 +1,1644 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\Connect
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ +public final class ConnectRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest) + ConnectRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ConnectRequest.newBuilder() to construct. + private ConnectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConnectRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConnectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConnectRequest( + 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.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder subBuilder = null; + if (requestCase_ == 1) { + subBuilder = ((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_).toBuilder(); + } + request_ = + input.readMessage(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + request_ = subBuilder.buildPartial(); + } + requestCase_ = 1; + break; + } + case 18: { + com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (requestCase_ == 2) { + subBuilder = ((com.google.showcase.v1beta1.Blurb) request_).toBuilder(); + } + request_ = + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.Blurb) request_); + request_ = subBuilder.buildPartial(); + } + requestCase_ = 2; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + public interface ConnectConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The room or profile to follow and create messages for.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+     * The room or profile to follow and create messages for.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + } + /** + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} + */ + public static final class ConnectConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + ConnectConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectConfig.newBuilder() to construct. + private ConnectConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConnectConfig() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConnectConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConnectConfig( + 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; + } + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+     * The room or profile to follow and create messages for.
+     * 
+ * + * string parent = 1 [(.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; + } + } + /** + *
+     * The room or profile to follow and create messages for.
+     * 
+ * + * string parent = 1 [(.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; + } + } + + 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_); + } + 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_); + } + 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.showcase.v1beta1.ConnectRequest.ConnectConfig)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other = (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) obj; + + if (!getParent() + .equals(other.getParent())) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig build() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig buildPartial() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(this); + result.parent_ = parent_; + 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.showcase.v1beta1.ConnectRequest.ConnectConfig) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.showcase.v1beta1.ConnectRequest.ConnectConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+       * The room or profile to follow and create messages for.
+       * 
+ * + * string parent = 1 [(.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; + } + } + /** + *
+       * The room or profile to follow and create messages for.
+       * 
+ * + * string parent = 1 [(.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; + } + } + /** + *
+       * The room or profile to follow and create messages for.
+       * 
+ * + * string parent = 1 [(.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; + } + /** + *
+       * The room or profile to follow and create messages for.
+       * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+       * The room or profile to follow and create messages for.
+       * 
+ * + * string parent = 1 [(.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; + } + @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.showcase.v1beta1.ConnectRequest.ConnectConfig) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + private static final com.google.showcase.v1beta1.ConnectRequest.ConnectConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConnectConfig(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.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int requestCase_ = 0; + private java.lang.Object request_; + public enum RequestCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONFIG(1), + BLURB(2), + REQUEST_NOT_SET(0); + private final int value; + private RequestCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequestCase valueOf(int value) { + return forNumber(value); + } + + public static RequestCase forNumber(int value) { + switch (value) { + case 1: return CONFIG; + case 2: return BLURB; + case 0: return REQUEST_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public RequestCase + getRequestCase() { + return RequestCase.forNumber( + requestCase_); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + /** + *
+   * Provides information that specifies how to process subsequent requests.
+   * The first `ConnectRequest` message must contain a `config`  message.
+   * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + /** + *
+   * Provides information that specifies how to process subsequent requests.
+   * The first `ConnectRequest` message must contain a `config`  message.
+   * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + /** + *
+   * Provides information that specifies how to process subsequent requests.
+   * The first `ConnectRequest` message must contain a `config`  message.
+   * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + public static final int BLURB_FIELD_NUMBER = 2; + /** + *
+   * The blurb to be created.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + /** + *
+   * The blurb to be created.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + /** + *
+   * The blurb to be created.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (requestCase_ == 1) { + output.writeMessage(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + output.writeMessage(2, (com.google.showcase.v1beta1.Blurb) request_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requestCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.showcase.v1beta1.Blurb) request_); + } + 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.showcase.v1beta1.ConnectRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest other = (com.google.showcase.v1beta1.ConnectRequest) obj; + + if (!getRequestCase().equals(other.getRequestCase())) return false; + switch (requestCase_) { + case 1: + if (!getConfig() + .equals(other.getConfig())) return false; + break; + case 2: + if (!getBlurb() + .equals(other.getBlurb())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (requestCase_) { + case 1: + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + break; + case 2: + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\Connect
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest) + com.google.showcase.v1beta1.ConnectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.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(); + requestCase_ = 0; + request_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest build() { + com.google.showcase.v1beta1.ConnectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest buildPartial() { + com.google.showcase.v1beta1.ConnectRequest result = new com.google.showcase.v1beta1.ConnectRequest(this); + if (requestCase_ == 1) { + if (configBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = configBuilder_.build(); + } + } + if (requestCase_ == 2) { + if (blurbBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = blurbBuilder_.build(); + } + } + result.requestCase_ = requestCase_; + 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.showcase.v1beta1.ConnectRequest) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance()) return this; + switch (other.getRequestCase()) { + case CONFIG: { + mergeConfig(other.getConfig()); + break; + } + case BLURB: { + mergeBlurb(other.getBlurb()); + break; + } + case REQUEST_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ConnectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ConnectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int requestCase_ = 0; + private java.lang.Object request_; + public RequestCase + getRequestCase() { + return RequestCase.forNumber( + requestCase_); + } + + public Builder clearRequest() { + requestCase_ = 0; + request_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> configBuilder_; + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } else { + if (requestCase_ == 1) { + return configBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + requestCase_ = 1; + return this; + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder builderForValue) { + if (configBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 1; + return this; + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder mergeConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (requestCase_ == 1 && + request_ != com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) { + request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_) + .mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 1) { + configBuilder_.mergeFrom(value); + } else { + configBuilder_.setMessage(value); + } + } + requestCase_ = 1; + return this; + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + } + configBuilder_.clear(); + } + return this; + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder getConfigBuilder() { + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if ((requestCase_ == 1) && (configBuilder_ != null)) { + return configBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + /** + *
+     * Provides information that specifies how to process subsequent requests.
+     * The first `ConnectRequest` message must contain a `config`  message.
+     * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + if (!(requestCase_ == 1)) { + request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder>( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 1; + onChanged();; + return configBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } else { + if (requestCase_ == 2) { + return blurbBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + requestCase_ = 2; + return this; + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb( + com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 2; + return this; + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (requestCase_ == 2 && + request_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + request_ = com.google.showcase.v1beta1.Blurb.newBuilder((com.google.showcase.v1beta1.Blurb) request_) + .mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 2) { + blurbBuilder_.mergeFrom(value); + } else { + blurbBuilder_.setMessage(value); + } + } + requestCase_ = 2; + return this; + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + } + blurbBuilder_.clear(); + } + return this; + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + return getBlurbFieldBuilder().getBuilder(); + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if ((requestCase_ == 2) && (blurbBuilder_ != null)) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + /** + *
+     * The blurb to be created.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + if (!(requestCase_ == 2)) { + request_ = com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( + (com.google.showcase.v1beta1.Blurb) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 2; + onChanged();; + return blurbBuilder_; + } + @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.showcase.v1beta1.ConnectRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest) + private static final com.google.showcase.v1beta1.ConnectRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest(); + } + + public static com.google.showcase.v1beta1.ConnectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConnectRequest(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.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java new file mode 100644 index 0000000000..69ed6fc296 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ConnectRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Provides information that specifies how to process subsequent requests.
+   * The first `ConnectRequest` message must contain a `config`  message.
+   * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Provides information that specifies how to process subsequent requests.
+   * The first `ConnectRequest` message must contain a `config`  message.
+   * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * @return The config. + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig(); + /** + *
+   * Provides information that specifies how to process subsequent requests.
+   * The first `ConnectRequest` message must contain a `config`  message.
+   * 
+ * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * The blurb to be created.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + /** + *
+   * The blurb to be created.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + /** + *
+   * The blurb to be created.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + public com.google.showcase.v1beta1.ConnectRequest.RequestCase getRequestCase(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java new file mode 100644 index 0000000000..3d6c3396ca --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java @@ -0,0 +1,149 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf enum {@code google.showcase.v1beta1.Continent} + */ +public enum Continent + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CONTINENT_UNSPECIFIED = 0; + */ + CONTINENT_UNSPECIFIED(0), + /** + * AFRICA = 1; + */ + AFRICA(1), + /** + * AMERICA = 2; + */ + AMERICA(2), + /** + * ANTARTICA = 3; + */ + ANTARTICA(3), + /** + * AUSTRALIA = 4; + */ + AUSTRALIA(4), + /** + * EUROPE = 5; + */ + EUROPE(5), + UNRECOGNIZED(-1), + ; + + /** + * CONTINENT_UNSPECIFIED = 0; + */ + public static final int CONTINENT_UNSPECIFIED_VALUE = 0; + /** + * AFRICA = 1; + */ + public static final int AFRICA_VALUE = 1; + /** + * AMERICA = 2; + */ + public static final int AMERICA_VALUE = 2; + /** + * ANTARTICA = 3; + */ + public static final int ANTARTICA_VALUE = 3; + /** + * AUSTRALIA = 4; + */ + public static final int AUSTRALIA_VALUE = 4; + /** + * EUROPE = 5; + */ + public static final int EUROPE_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 Continent 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 Continent forNumber(int value) { + switch (value) { + case 0: return CONTINENT_UNSPECIFIED; + case 1: return AFRICA; + case 2: return AMERICA; + case 3: return ANTARTICA; + case 4: return AUSTRALIA; + case 5: return EUROPE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Continent> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Continent findValueByNumber(int number) { + return Continent.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.showcase.v1beta1.ComplianceOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Continent[] VALUES = values(); + + public static Continent 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 Continent(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Continent) +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java new file mode 100644 index 0000000000..1fed27c664 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java @@ -0,0 +1,840 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ +public final class CreateBlurbRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateBlurbRequest) + CreateBlurbRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateBlurbRequest.newBuilder() to construct. + private CreateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateBlurbRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateBlurbRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (blurb_ != null) { + subBuilder = blurb_.toBuilder(); + } + blurb_ = input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(blurb_); + blurb_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The resource name of the chat room or user profile that this blurb will
+   * be tied to.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the chat room or user profile that this blurb will
+   * be tied to.
+   * 
+ * + * 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 BLURB_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Blurb blurb_; + /** + *
+   * The blurb to create.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return blurb_ != null; + } + /** + *
+   * The blurb to create.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + /** + *
+   * The blurb to create.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return getBlurb(); + } + + 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 (blurb_ != null) { + output.writeMessage(2, getBlurb()); + } + 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 (blurb_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getBlurb()); + } + 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.showcase.v1beta1.CreateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateBlurbRequest other = (com.google.showcase.v1beta1.CreateBlurbRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb() + .equals(other.getBlurb())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateBlurbRequest) + com.google.showcase.v1beta1.CreateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (blurbBuilder_ == null) { + blurb_ = null; + } else { + blurb_ = null; + blurbBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest build() { + com.google.showcase.v1beta1.CreateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.CreateBlurbRequest result = new com.google.showcase.v1beta1.CreateBlurbRequest(this); + result.parent_ = parent_; + if (blurbBuilder_ == null) { + result.blurb_ = blurb_; + } else { + result.blurb_ = blurbBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateBlurbRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + 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.showcase.v1beta1.CreateBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The resource name of the chat room or user profile that this blurb will
+     * be tied to.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the chat room or user profile that this blurb will
+     * be tied to.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the chat room or user profile that this blurb will
+     * be tied to.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the chat room or user profile that this blurb will
+     * be tied to.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the chat room or user profile that this blurb will
+     * be tied to.
+     * 
+ * + * 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 com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return blurbBuilder_ != null || blurb_ != null; + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb( + com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (blurb_ != null) { + blurb_ = + com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); + } else { + blurb_ = value; + } + onChanged(); + } else { + blurbBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + blurb_ = null; + onChanged(); + } else { + blurb_ = null; + blurbBuilder_ = null; + } + + return this; + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? + com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + /** + *
+     * The blurb to create.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), + getParentForChildren(), + isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + @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.showcase.v1beta1.CreateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateBlurbRequest) + private static final com.google.showcase.v1beta1.CreateBlurbRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateBlurbRequest(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.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..53ed164793 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface CreateBlurbRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the chat room or user profile that this blurb will
+   * be tied to.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * The resource name of the chat room or user profile that this blurb will
+   * be tied to.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The blurb to create.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + /** + *
+   * The blurb to create.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + /** + *
+   * The blurb to create.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java new file mode 100644 index 0000000000..5982b2f59c --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java @@ -0,0 +1,667 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ +public final class CreateRoomRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateRoomRequest) + CreateRoomRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateRoomRequest.newBuilder() to construct. + private CreateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateRoomRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateRoomRequest( + 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.showcase.v1beta1.Room.Builder subBuilder = null; + if (room_ != null) { + subBuilder = room_.toBuilder(); + } + room_ = input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(room_); + room_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + /** + *
+   * The room to create.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return room_ != null; + } + /** + *
+   * The room to create.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + /** + *
+   * The room to create.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return getRoom(); + } + + 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 (room_ != null) { + output.writeMessage(1, getRoom()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (room_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRoom()); + } + 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.showcase.v1beta1.CreateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateRoomRequest other = (com.google.showcase.v1beta1.CreateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom() + .equals(other.getRoom())) 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 (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateRoomRequest) + com.google.showcase.v1beta1.CreateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateRoomRequest.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 (roomBuilder_ == null) { + room_ = null; + } else { + room_ = null; + roomBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest build() { + com.google.showcase.v1beta1.CreateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest buildPartial() { + com.google.showcase.v1beta1.CreateRoomRequest result = new com.google.showcase.v1beta1.CreateRoomRequest(this); + if (roomBuilder_ == null) { + result.room_ = room_; + } else { + result.room_ = roomBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateRoomRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateRoomRequest other) { + if (other == com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + 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.showcase.v1beta1.CreateRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> roomBuilder_; + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return roomBuilder_ != null || room_ != null; + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + onChanged(); + } else { + roomBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom( + com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + onChanged(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (room_ != null) { + room_ = + com.google.showcase.v1beta1.Room.newBuilder(room_).mergeFrom(value).buildPartial(); + } else { + room_ = value; + } + onChanged(); + } else { + roomBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + if (roomBuilder_ == null) { + room_ = null; + onChanged(); + } else { + room_ = null; + roomBuilder_ = null; + } + + return this; + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + + onChanged(); + return getRoomFieldBuilder().getBuilder(); + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? + com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + /** + *
+     * The room to create.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> + getRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), + getParentForChildren(), + isClean()); + room_ = null; + } + return roomBuilder_; + } + @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.showcase.v1beta1.CreateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateRoomRequest) + private static final com.google.showcase.v1beta1.CreateRoomRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateRoomRequest(); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateRoomRequest(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.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..c912301453 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface CreateRoomRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The room to create.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return Whether the room field is set. + */ + boolean hasRoom(); + /** + *
+   * The room to create.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + /** + *
+   * The room to create.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java new file mode 100644 index 0000000000..2f8b0a890f --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java @@ -0,0 +1,609 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} + */ +public final class CreateSequenceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSequenceRequest) + CreateSequenceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateSequenceRequest.newBuilder() to construct. + private CreateSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateSequenceRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateSequenceRequest( + 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.showcase.v1beta1.Sequence.Builder subBuilder = null; + if (sequence_ != null) { + subBuilder = sequence_.toBuilder(); + } + sequence_ = input.readMessage(com.google.showcase.v1beta1.Sequence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sequence_); + sequence_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + public static final int SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Sequence sequence_; + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * @return Whether the sequence field is set. + */ + @java.lang.Override + public boolean hasSequence() { + return sequence_ != null; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * @return The sequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getSequence() { + return sequence_ == null ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() : sequence_; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + return getSequence(); + } + + 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 (sequence_ != null) { + output.writeMessage(1, getSequence()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sequence_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSequence()); + } + 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.showcase.v1beta1.CreateSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSequenceRequest other = (com.google.showcase.v1beta1.CreateSequenceRequest) obj; + + if (hasSequence() != other.hasSequence()) return false; + if (hasSequence()) { + if (!getSequence() + .equals(other.getSequence())) 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 (hasSequence()) { + hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getSequence().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSequenceRequest) + com.google.showcase.v1beta1.CreateSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSequenceRequest.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 (sequenceBuilder_ == null) { + sequence_ = null; + } else { + sequence_ = null; + sequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest build() { + com.google.showcase.v1beta1.CreateSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateSequenceRequest result = new com.google.showcase.v1beta1.CreateSequenceRequest(this); + if (sequenceBuilder_ == null) { + result.sequence_ = sequence_; + } else { + result.sequence_ = sequenceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSequenceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance()) return this; + if (other.hasSequence()) { + mergeSequence(other.getSequence()); + } + 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.showcase.v1beta1.CreateSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Sequence sequence_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, com.google.showcase.v1beta1.Sequence.Builder, com.google.showcase.v1beta1.SequenceOrBuilder> sequenceBuilder_; + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * @return Whether the sequence field is set. + */ + public boolean hasSequence() { + return sequenceBuilder_ != null || sequence_ != null; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * @return The sequence. + */ + public com.google.showcase.v1beta1.Sequence getSequence() { + if (sequenceBuilder_ == null) { + return sequence_ == null ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() : sequence_; + } else { + return sequenceBuilder_.getMessage(); + } + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sequence_ = value; + onChanged(); + } else { + sequenceBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + public Builder setSequence( + com.google.showcase.v1beta1.Sequence.Builder builderForValue) { + if (sequenceBuilder_ == null) { + sequence_ = builderForValue.build(); + onChanged(); + } else { + sequenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + public Builder mergeSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (sequence_ != null) { + sequence_ = + com.google.showcase.v1beta1.Sequence.newBuilder(sequence_).mergeFrom(value).buildPartial(); + } else { + sequence_ = value; + } + onChanged(); + } else { + sequenceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + public Builder clearSequence() { + if (sequenceBuilder_ == null) { + sequence_ = null; + onChanged(); + } else { + sequence_ = null; + sequenceBuilder_ = null; + } + + return this; + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + public com.google.showcase.v1beta1.Sequence.Builder getSequenceBuilder() { + + onChanged(); + return getSequenceFieldBuilder().getBuilder(); + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + if (sequenceBuilder_ != null) { + return sequenceBuilder_.getMessageOrBuilder(); + } else { + return sequence_ == null ? + com.google.showcase.v1beta1.Sequence.getDefaultInstance() : sequence_; + } + } + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, com.google.showcase.v1beta1.Sequence.Builder, com.google.showcase.v1beta1.SequenceOrBuilder> + getSequenceFieldBuilder() { + if (sequenceBuilder_ == null) { + sequenceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, com.google.showcase.v1beta1.Sequence.Builder, com.google.showcase.v1beta1.SequenceOrBuilder>( + getSequence(), + getParentForChildren(), + isClean()); + sequence_ = null; + } + return sequenceBuilder_; + } + @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.showcase.v1beta1.CreateSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSequenceRequest) + private static final com.google.showcase.v1beta1.CreateSequenceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSequenceRequest(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.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..5f99147ab5 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface CreateSequenceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * @return Whether the sequence field is set. + */ + boolean hasSequence(); + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * @return The sequence. + */ + com.google.showcase.v1beta1.Sequence getSequence(); + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + */ + com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java new file mode 100644 index 0000000000..2d2d8bfa81 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java @@ -0,0 +1,689 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for the CreateSession method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ +public final class CreateSessionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSessionRequest) + CreateSessionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateSessionRequest.newBuilder() to construct. + private CreateSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateSessionRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateSessionRequest( + 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.showcase.v1beta1.Session.Builder subBuilder = null; + if (session_ != null) { + subBuilder = session_.toBuilder(); + } + session_ = input.readMessage(com.google.showcase.v1beta1.Session.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(session_); + session_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + public static final int SESSION_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Session session_; + /** + *
+   * The session to be created.
+   * Sessions are immutable once they are created (although they can
+   * be deleted).
+   * 
+ * + * .google.showcase.v1beta1.Session session = 1; + * @return Whether the session field is set. + */ + @java.lang.Override + public boolean hasSession() { + return session_ != null; + } + /** + *
+   * The session to be created.
+   * Sessions are immutable once they are created (although they can
+   * be deleted).
+   * 
+ * + * .google.showcase.v1beta1.Session session = 1; + * @return The session. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSession() { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + /** + *
+   * The session to be created.
+   * Sessions are immutable once they are created (although they can
+   * be deleted).
+   * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + return getSession(); + } + + 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 (session_ != null) { + output.writeMessage(1, getSession()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (session_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSession()); + } + 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.showcase.v1beta1.CreateSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSessionRequest other = (com.google.showcase.v1beta1.CreateSessionRequest) obj; + + if (hasSession() != other.hasSession()) return false; + if (hasSession()) { + if (!getSession() + .equals(other.getSession())) 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 (hasSession()) { + hash = (37 * hash) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest 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; + } + /** + *
+   * The request for the CreateSession method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSessionRequest) + com.google.showcase.v1beta1.CreateSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSessionRequest.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 (sessionBuilder_ == null) { + session_ = null; + } else { + session_ = null; + sessionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest build() { + com.google.showcase.v1beta1.CreateSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest buildPartial() { + com.google.showcase.v1beta1.CreateSessionRequest result = new com.google.showcase.v1beta1.CreateSessionRequest(this); + if (sessionBuilder_ == null) { + result.session_ = session_; + } else { + result.session_ = sessionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSessionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSessionRequest other) { + if (other == com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance()) return this; + if (other.hasSession()) { + mergeSession(other.getSession()); + } + 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.showcase.v1beta1.CreateSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Session session_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> sessionBuilder_; + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + * @return Whether the session field is set. + */ + public boolean hasSession() { + return sessionBuilder_ != null || session_ != null; + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + * @return The session. + */ + public com.google.showcase.v1beta1.Session getSession() { + if (sessionBuilder_ == null) { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } else { + return sessionBuilder_.getMessage(); + } + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + session_ = value; + onChanged(); + } else { + sessionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession( + com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionBuilder_ == null) { + session_ = builderForValue.build(); + onChanged(); + } else { + sessionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder mergeSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (session_ != null) { + session_ = + com.google.showcase.v1beta1.Session.newBuilder(session_).mergeFrom(value).buildPartial(); + } else { + session_ = value; + } + onChanged(); + } else { + sessionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder clearSession() { + if (sessionBuilder_ == null) { + session_ = null; + onChanged(); + } else { + session_ = null; + sessionBuilder_ = null; + } + + return this; + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionBuilder() { + + onChanged(); + return getSessionFieldBuilder().getBuilder(); + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + if (sessionBuilder_ != null) { + return sessionBuilder_.getMessageOrBuilder(); + } else { + return session_ == null ? + com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + } + /** + *
+     * The session to be created.
+     * Sessions are immutable once they are created (although they can
+     * be deleted).
+     * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> + getSessionFieldBuilder() { + if (sessionBuilder_ == null) { + sessionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder>( + getSession(), + getParentForChildren(), + isClean()); + session_ = null; + } + return sessionBuilder_; + } + @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.showcase.v1beta1.CreateSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSessionRequest) + private static final com.google.showcase.v1beta1.CreateSessionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSessionRequest(); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSessionRequest(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.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java new file mode 100644 index 0000000000..b4c5eacda6 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java @@ -0,0 +1,42 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface CreateSessionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The session to be created.
+   * Sessions are immutable once they are created (although they can
+   * be deleted).
+   * 
+ * + * .google.showcase.v1beta1.Session session = 1; + * @return Whether the session field is set. + */ + boolean hasSession(); + /** + *
+   * The session to be created.
+   * Sessions are immutable once they are created (although they can
+   * be deleted).
+   * 
+ * + * .google.showcase.v1beta1.Session session = 1; + * @return The session. + */ + com.google.showcase.v1beta1.Session getSession(); + /** + *
+   * The session to be created.
+   * Sessions are immutable once they are created (although they can
+   * be deleted).
+   * 
+ * + * .google.showcase.v1beta1.Session session = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java new file mode 100644 index 0000000000..46ab7f0be0 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java @@ -0,0 +1,667 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Identity\CreateUser
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ +public final class CreateUserRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateUserRequest) + CreateUserRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateUserRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateUserRequest( + 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.showcase.v1beta1.User.Builder subBuilder = null; + if (user_ != null) { + subBuilder = user_.toBuilder(); + } + user_ = input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(user_); + user_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + /** + *
+   * The user to create.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + *
+   * The user to create.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + /** + *
+   * The user to create.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return getUser(); + } + + 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 (user_ != null) { + output.writeMessage(1, getUser()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUser()); + } + 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.showcase.v1beta1.CreateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateUserRequest other = (com.google.showcase.v1beta1.CreateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) 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 (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Identity\CreateUser
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateUserRequest) + com.google.showcase.v1beta1.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateUserRequest.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 (userBuilder_ == null) { + user_ = null; + } else { + user_ = null; + userBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest build() { + com.google.showcase.v1beta1.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest buildPartial() { + com.google.showcase.v1beta1.CreateUserRequest result = new com.google.showcase.v1beta1.CreateUserRequest(this); + if (userBuilder_ == null) { + result.user_ = user_; + } else { + result.user_ = userBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateUserRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateUserRequest other) { + if (other == com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + 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.showcase.v1beta1.CreateUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> userBuilder_; + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return userBuilder_ != null || user_ != null; + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + onChanged(); + } else { + userBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser( + com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + onChanged(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (user_ != null) { + user_ = + com.google.showcase.v1beta1.User.newBuilder(user_).mergeFrom(value).buildPartial(); + } else { + user_ = value; + } + onChanged(); + } else { + userBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + if (userBuilder_ == null) { + user_ = null; + onChanged(); + } else { + user_ = null; + userBuilder_ = null; + } + + return this; + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + /** + *
+     * The user to create.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + @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.showcase.v1beta1.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateUserRequest) + private static final com.google.showcase.v1beta1.CreateUserRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateUserRequest(); + } + + public static com.google.showcase.v1beta1.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateUserRequest(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.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java new file mode 100644 index 0000000000..04a4c2ee57 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface CreateUserRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The user to create.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + *
+   * The user to create.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + /** + *
+   * The user to create.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java new file mode 100644 index 0000000000..5d3da97880 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ +public final class DeleteBlurbRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteBlurbRequest) + DeleteBlurbRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteBlurbRequest.newBuilder() to construct. + private DeleteBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteBlurbRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteBlurbRequest( + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * 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.showcase.v1beta1.DeleteBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteBlurbRequest other = (com.google.showcase.v1beta1.DeleteBlurbRequest) 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.showcase.v1beta1.DeleteBlurbRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.showcase.v1beta1.DeleteBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteBlurbRequest.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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest build() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest buildPartial() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = new com.google.showcase.v1beta1.DeleteBlurbRequest(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.showcase.v1beta1.DeleteBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteBlurbRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteBlurbRequest other) { + if (other == com.google.showcase.v1beta1.DeleteBlurbRequest.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.showcase.v1beta1.DeleteBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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.showcase.v1beta1.DeleteBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteBlurbRequest) + private static final com.google.showcase.v1beta1.DeleteBlurbRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteBlurbRequest(); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteBlurbRequest(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.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..7a44659377 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface DeleteBlurbRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java new file mode 100644 index 0000000000..2195ae35ea --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ +public final class DeleteRoomRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteRoomRequest) + DeleteRoomRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteRoomRequest.newBuilder() to construct. + private DeleteRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteRoomRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteRoomRequest( + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * 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.showcase.v1beta1.DeleteRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteRoomRequest other = (com.google.showcase.v1beta1.DeleteRoomRequest) 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.showcase.v1beta1.DeleteRoomRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteRoomRequest) + com.google.showcase.v1beta1.DeleteRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteRoomRequest.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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest build() { + com.google.showcase.v1beta1.DeleteRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest buildPartial() { + com.google.showcase.v1beta1.DeleteRoomRequest result = new com.google.showcase.v1beta1.DeleteRoomRequest(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.showcase.v1beta1.DeleteRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteRoomRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteRoomRequest other) { + if (other == com.google.showcase.v1beta1.DeleteRoomRequest.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.showcase.v1beta1.DeleteRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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.showcase.v1beta1.DeleteRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteRoomRequest) + private static final com.google.showcase.v1beta1.DeleteRoomRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteRoomRequest(); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteRoomRequest(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.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java new file mode 100644 index 0000000000..996f19d054 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface DeleteRoomRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java new file mode 100644 index 0000000000..c19f242654 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * Request for the DeleteSession method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ +public final class DeleteSessionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteSessionRequest) + DeleteSessionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteSessionRequest.newBuilder() to construct. + private DeleteSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteSessionRequest( + 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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The session to be deleted.
+   * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+   * The session to be deleted.
+   * 
+ * + * string name = 1 [(.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.showcase.v1beta1.DeleteSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteSessionRequest other = (com.google.showcase.v1beta1.DeleteSessionRequest) 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.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest 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 for the DeleteSession method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteSessionRequest) + com.google.showcase.v1beta1.DeleteSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteSessionRequest.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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest build() { + com.google.showcase.v1beta1.DeleteSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest buildPartial() { + com.google.showcase.v1beta1.DeleteSessionRequest result = new com.google.showcase.v1beta1.DeleteSessionRequest(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.showcase.v1beta1.DeleteSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteSessionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteSessionRequest other) { + if (other == com.google.showcase.v1beta1.DeleteSessionRequest.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.showcase.v1beta1.DeleteSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The session to be deleted.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The session to be deleted.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The session to be deleted.
+     * 
+ * + * string name = 1 [(.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; + } + /** + *
+     * The session to be deleted.
+     * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The session to be deleted.
+     * 
+ * + * string name = 1 [(.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.showcase.v1beta1.DeleteSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteSessionRequest) + private static final com.google.showcase.v1beta1.DeleteSessionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteSessionRequest(); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSessionRequest(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.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java new file mode 100644 index 0000000000..a4df0df04a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface DeleteSessionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The session to be deleted.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The session to be deleted.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java new file mode 100644 index 0000000000..0375608a88 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * Request message for deleting a test.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ +public final class DeleteTestRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteTestRequest) + DeleteTestRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteTestRequest.newBuilder() to construct. + private DeleteTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteTestRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteTestRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteTestRequest( + 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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The test to be deleted.
+   * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+   * The test to be deleted.
+   * 
+ * + * string name = 1 [(.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.showcase.v1beta1.DeleteTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteTestRequest other = (com.google.showcase.v1beta1.DeleteTestRequest) 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.showcase.v1beta1.DeleteTestRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest 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 deleting a test.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteTestRequest) + com.google.showcase.v1beta1.DeleteTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteTestRequest.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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest build() { + com.google.showcase.v1beta1.DeleteTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest buildPartial() { + com.google.showcase.v1beta1.DeleteTestRequest result = new com.google.showcase.v1beta1.DeleteTestRequest(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.showcase.v1beta1.DeleteTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteTestRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteTestRequest other) { + if (other == com.google.showcase.v1beta1.DeleteTestRequest.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.showcase.v1beta1.DeleteTestRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteTestRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The test to be deleted.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The test to be deleted.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The test to be deleted.
+     * 
+ * + * string name = 1 [(.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; + } + /** + *
+     * The test to be deleted.
+     * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The test to be deleted.
+     * 
+ * + * string name = 1 [(.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.showcase.v1beta1.DeleteTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteTestRequest) + private static final com.google.showcase.v1beta1.DeleteTestRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteTestRequest(); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTestRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTestRequest(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.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java new file mode 100644 index 0000000000..c50480e596 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface DeleteTestRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The test to be deleted.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The test to be deleted.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java new file mode 100644 index 0000000000..c1726da0cd --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Identity\DeleteUser
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ +public final class DeleteUserRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteUserRequest) + DeleteUserRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteUserRequest( + 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.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the user to delete.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the user to delete.
+   * 
+ * + * 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.showcase.v1beta1.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteUserRequest other = (com.google.showcase.v1beta1.DeleteUserRequest) 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.showcase.v1beta1.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Identity\DeleteUser
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteUserRequest) + com.google.showcase.v1beta1.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteUserRequest.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.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest build() { + com.google.showcase.v1beta1.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest buildPartial() { + com.google.showcase.v1beta1.DeleteUserRequest result = new com.google.showcase.v1beta1.DeleteUserRequest(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.showcase.v1beta1.DeleteUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteUserRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteUserRequest other) { + if (other == com.google.showcase.v1beta1.DeleteUserRequest.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.showcase.v1beta1.DeleteUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the user to delete.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the user to delete.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the user to delete.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the user to delete.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the user to delete.
+     * 
+ * + * 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.showcase.v1beta1.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteUserRequest) + private static final com.google.showcase.v1beta1.DeleteUserRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteUserRequest(); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteUserRequest(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.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java new file mode 100644 index 0000000000..8589132d61 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface DeleteUserRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the user to delete.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the user to delete.
+   * 
+ * + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java new file mode 100644 index 0000000000..7f860781d4 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java @@ -0,0 +1,301 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public final class EchoOuterClass { + private EchoOuterClass() {} + 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_showcase_v1beta1_EchoRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n)schema/google/showcase/v1beta1/echo.pr" + + "oto\022\027google.showcase.v1beta1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\030go" + + "ogle/api/routing.proto\032#google/longrunni" + + "ng/operations.proto\032\036google/protobuf/dur" + + "ation.proto\032\037google/protobuf/timestamp.p" + + "roto\032\027google/rpc/status.proto\"\254\001\n\013EchoRe" + + "quest\022\021\n\007content\030\001 \001(\tH\000\022#\n\005error\030\002 \001(\0132" + + "\022.google.rpc.StatusH\000\0223\n\010severity\030\003 \001(\0162" + + "!.google.showcase.v1beta1.Severity\022\016\n\006he" + + "ader\030\004 \001(\t\022\024\n\014other_header\030\005 \001(\tB\n\n\010resp" + + "onse\"T\n\014EchoResponse\022\017\n\007content\030\001 \001(\t\0223\n" + + "\010severity\030\002 \001(\0162!.google.showcase.v1beta" + + "1.Severity\"C\n\rExpandRequest\022\017\n\007content\030\001" + + " \001(\t\022!\n\005error\030\002 \001(\0132\022.google.rpc.Status\"" + + "Q\n\022PagedExpandRequest\022\024\n\007content\030\001 \001(\tB\003" + + "\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" + + "(\t\"Y\n\030PagedExpandLegacyRequest\022\024\n\007conten" + + "t\030\001 \001(\tB\003\340A\002\022\023\n\013max_results\030\002 \001(\005\022\022\n\npag" + + "e_token\030\003 \001(\t\"h\n\023PagedExpandResponse\0228\n\t" + + "responses\030\001 \003(\0132%.google.showcase.v1beta" + + "1.EchoResponse\022\027\n\017next_page_token\030\002 \001(\t\"" + + "(\n\027PagedExpandResponseList\022\r\n\005words\030\001 \003(" + + "\t\"\203\002\n\037PagedExpandLegacyMappedResponse\022`\n" + + "\014alphabetized\030\001 \003(\0132J.google.showcase.v1" + + "beta1.PagedExpandLegacyMappedResponse.Al" + + "phabetizedEntry\022\027\n\017next_page_token\030\002 \001(\t" + + "\032e\n\021AlphabetizedEntry\022\013\n\003key\030\001 \001(\t\022?\n\005va" + + "lue\030\002 \001(\01320.google.showcase.v1beta1.Page" + + "dExpandResponseList:\0028\001\"\331\001\n\013WaitRequest\022" + + ".\n\010end_time\030\001 \001(\0132\032.google.protobuf.Time" + + "stampH\000\022(\n\003ttl\030\004 \001(\0132\031.google.protobuf.D" + + "urationH\000\022#\n\005error\030\002 \001(\0132\022.google.rpc.St" + + "atusH\001\0228\n\007success\030\003 \001(\0132%.google.showcas" + + "e.v1beta1.WaitResponseH\001B\005\n\003endB\n\n\010respo" + + "nse\"\037\n\014WaitResponse\022\017\n\007content\030\001 \001(\t\"<\n\014" + + "WaitMetadata\022,\n\010end_time\030\001 \001(\0132\032.google." + + "protobuf.Timestamp\"\255\001\n\014BlockRequest\0221\n\016r" + + "esponse_delay\030\001 \001(\0132\031.google.protobuf.Du" + + "ration\022#\n\005error\030\002 \001(\0132\022.google.rpc.Statu" + + "sH\000\0229\n\007success\030\003 \001(\0132&.google.showcase.v" + + "1beta1.BlockResponseH\000B\n\n\010response\" \n\rBl" + + "ockResponse\022\017\n\007content\030\001 \001(\t*D\n\010Severity" + + "\022\017\n\013UNNECESSARY\020\000\022\r\n\tNECESSARY\020\001\022\n\n\006URGE" + + "NT\020\002\022\014\n\010CRITICAL\020\0032\377\013\n\004Echo\022\224\003\n\004Echo\022$.g" + + "oogle.showcase.v1beta1.EchoRequest\032%.goo" + + "gle.showcase.v1beta1.EchoResponse\"\276\002\202\323\344\223" + + "\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n\006head" + + "er\022\031\n\006header\022\017{routing_id=**}\022+\n\006header\022" + + "!{table_name=regions/*/zones/*/**}\022\"\n\006he" + + "ader\022\030{super_id=projects/*}/**\0220\n\006header" + + "\022&{table_name=projects/*/instances/*/**}" + + "\0221\n\006header\022\'projects/*/{instance_id=inst" + + "ances/*}/**\022\030\n\014other_header\022\010{baz=**}\022#\n" + + "\014other_header\022\023{qux=projects/*}/**\022\212\001\n\006E" + + "xpand\022&.google.showcase.v1beta1.ExpandRe" + + "quest\032%.google.showcase.v1beta1.EchoResp" + + "onse\"/\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*\332A\r" + + "content,error0\001\022z\n\007Collect\022$.google.show" + + "case.v1beta1.EchoRequest\032%.google.showca" + + "se.v1beta1.EchoResponse\" \202\323\344\223\002\032\"\025/v1beta" + + "1/echo:collect:\001*(\001\022W\n\004Chat\022$.google.sho" + + "wcase.v1beta1.EchoRequest\032%.google.showc" + + "ase.v1beta1.EchoResponse(\0010\001\022\216\001\n\013PagedEx" + + "pand\022+.google.showcase.v1beta1.PagedExpa" + + "ndRequest\032,.google.showcase.v1beta1.Page" + + "dExpandResponse\"$\202\323\344\223\002\036\"\031/v1beta1/echo:p" + + "agedExpand:\001*\022\240\001\n\021PagedExpandLegacy\0221.go" + + "ogle.showcase.v1beta1.PagedExpandLegacyR" + + "equest\032,.google.showcase.v1beta1.PagedEx" + + "pandResponse\"*\202\323\344\223\002$\"\037/v1beta1/echo:page" + + "dExpandLegacy:\001*\022\262\001\n\027PagedExpandLegacyMa" + + "pped\022+.google.showcase.v1beta1.PagedExpa" + + "ndRequest\0328.google.showcase.v1beta1.Page" + + "dExpandLegacyMappedResponse\"0\202\323\344\223\002*\"%/v1" + + "beta1/echo:pagedExpandLegacyMapped:\001*\022\211\001" + + "\n\004Wait\022$.google.showcase.v1beta1.WaitReq" + + "uest\032\035.google.longrunning.Operation\"<\202\323\344" + + "\223\002\027\"\022/v1beta1/echo:wait:\001*\312A\034\n\014WaitRespo" + + "nse\022\014WaitMetadata\022v\n\005Block\022%.google.show" + + "case.v1beta1.BlockRequest\032&.google.showc" + + "ase.v1beta1.BlockResponse\"\036\202\323\344\223\002\030\"\023/v1be" + + "ta1/echo:block:\001*\032\021\312A\016localhost:7469Bq\n\033" + + "com.google.showcase.v1beta1P\001Z4github.co" + + "m/googleapis/gapic-showcase/server/genpr" + + "oto\352\002\031Google::Showcase::V1beta1b\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.RoutingProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_EchoRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoRequest_descriptor, + new java.lang.String[] { "Content", "Error", "Severity", "Header", "OtherHeader", "Response", }); + internal_static_google_showcase_v1beta1_EchoResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoResponse_descriptor, + new java.lang.String[] { "Content", "Severity", }); + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor, + new java.lang.String[] { "Content", "Error", }); + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor, + new java.lang.String[] { "Content", "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor, + new java.lang.String[] { "Content", "MaxResults", "PageToken", }); + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor, + new java.lang.String[] { "Responses", "NextPageToken", }); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor, + new java.lang.String[] { "Words", }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor, + new java.lang.String[] { "Alphabetized", "NextPageToken", }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor = + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_showcase_v1beta1_WaitRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitRequest_descriptor, + new java.lang.String[] { "EndTime", "Ttl", "Error", "Success", "End", "Response", }); + internal_static_google_showcase_v1beta1_WaitResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitResponse_descriptor, + new java.lang.String[] { "Content", }); + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor, + new java.lang.String[] { "EndTime", }); + internal_static_google_showcase_v1beta1_BlockRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockRequest_descriptor, + new java.lang.String[] { "ResponseDelay", "Error", "Success", "Response", }); + internal_static_google_showcase_v1beta1_BlockResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockResponse_descriptor, + new java.lang.String[] { "Content", }); + 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.RoutingProto.routing); + 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.RoutingProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java new file mode 100644 index 0000000000..7fb30c11fe --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java @@ -0,0 +1,1439 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message used for the Echo, Collect and Chat methods.
+ * If content or opt are set in this message then the request will succeed.
+ * If status is set in this message then the status will be returned as an
+ * error.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ +public final class EchoRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoRequest) + EchoRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use EchoRequest.newBuilder() to construct. + private EchoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EchoRequest() { + severity_ = 0; + header_ = ""; + otherHeader_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EchoRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EchoRequest( + 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(); + responseCase_ = 1; + response_ = s; + break; + } + case 18: { + com.google.rpc.Status.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = ((com.google.rpc.Status) response_).toBuilder(); + } + response_ = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.rpc.Status) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + break; + } + case 24: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + header_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + otherHeader_ = 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.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + private int responseCase_ = 0; + private java.lang.Object response_; + public enum ResponseCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + ERROR(2), + RESPONSE_NOT_SET(0); + private final int value; + private ResponseCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 1: return CONTENT; + case 2: return ERROR; + case 0: return RESPONSE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ResponseCase + getResponseCase() { + return ResponseCase.forNumber( + responseCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + /** + *
+   * The content to be echoed by the server.
+   * 
+ * + * string content = 1; + * @return Whether the content field is set. + */ + public boolean hasContent() { + return responseCase_ == 1; + } + /** + *
+   * The content to be echoed by the server.
+   * 
+ * + * string content = 1; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (responseCase_ == 1) { + response_ = s; + } + return s; + } + } + /** + *
+   * The content to be echoed by the server.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + /** + *
+   * The error to be thrown by the server.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + /** + *
+   * The error to be thrown by the server.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + /** + *
+   * The error to be thrown by the server.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SEVERITY_FIELD_NUMBER = 3; + private int severity_; + /** + *
+   * The severity to be echoed by the server.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override public int getSeverityValue() { + return severity_; + } + /** + *
+   * The severity to be echoed by the server.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return The severity. + */ + @java.lang.Override public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int HEADER_FIELD_NUMBER = 4; + private volatile java.lang.Object header_; + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string header = 4; + * @return The header. + */ + @java.lang.Override + public java.lang.String getHeader() { + java.lang.Object ref = header_; + 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(); + header_ = s; + return s; + } + } + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string header = 4; + * @return The bytes for header. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_HEADER_FIELD_NUMBER = 5; + private volatile java.lang.Object otherHeader_; + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string other_header = 5; + * @return The otherHeader. + */ + @java.lang.Override + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + 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(); + otherHeader_ = s; + return s; + } + } + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string other_header = 5; + * @return The bytes for otherHeader. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + otherHeader_ = 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 (responseCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(3, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, header_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, otherHeader_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_); + } + if (responseCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, header_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, otherHeader_); + } + 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.showcase.v1beta1.EchoRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoRequest other = (com.google.showcase.v1beta1.EchoRequest) obj; + + if (severity_ != other.severity_) return false; + if (!getHeader() + .equals(other.getHeader())) return false; + if (!getOtherHeader() + .equals(other.getOtherHeader())) return false; + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 1: + if (!getContent() + .equals(other.getContent())) return false; + break; + case 2: + if (!getError() + .equals(other.getError())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + HEADER_FIELD_NUMBER; + hash = (53 * hash) + getHeader().hashCode(); + hash = (37 * hash) + OTHER_HEADER_FIELD_NUMBER; + hash = (53 * hash) + getOtherHeader().hashCode(); + switch (responseCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest 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; + } + /** + *
+   * The request message used for the Echo, Collect and Chat methods.
+   * If content or opt are set in this message then the request will succeed.
+   * If status is set in this message then the status will be returned as an
+   * error.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoRequest) + com.google.showcase.v1beta1.EchoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoRequest.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(); + severity_ = 0; + + header_ = ""; + + otherHeader_ = ""; + + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest build() { + com.google.showcase.v1beta1.EchoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest buildPartial() { + com.google.showcase.v1beta1.EchoRequest result = new com.google.showcase.v1beta1.EchoRequest(this); + if (responseCase_ == 1) { + result.response_ = response_; + } + if (responseCase_ == 2) { + if (errorBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = errorBuilder_.build(); + } + } + result.severity_ = severity_; + result.header_ = header_; + result.otherHeader_ = otherHeader_; + result.responseCase_ = responseCase_; + 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.showcase.v1beta1.EchoRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoRequest other) { + if (other == com.google.showcase.v1beta1.EchoRequest.getDefaultInstance()) return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getHeader().isEmpty()) { + header_ = other.header_; + onChanged(); + } + if (!other.getOtherHeader().isEmpty()) { + otherHeader_ = other.otherHeader_; + onChanged(); + } + switch (other.getResponseCase()) { + case CONTENT: { + responseCase_ = 1; + response_ = other.response_; + onChanged(); + break; + } + case ERROR: { + mergeError(other.getError()); + break; + } + case RESPONSE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EchoRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int responseCase_ = 0; + private java.lang.Object response_; + public ResponseCase + getResponseCase() { + return ResponseCase.forNumber( + responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + + /** + *
+     * The content to be echoed by the server.
+     * 
+ * + * string content = 1; + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return responseCase_ == 1; + } + /** + *
+     * The content to be echoed by the server.
+     * 
+ * + * string content = 1; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (responseCase_ == 1) { + response_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The content to be echoed by the server.
+     * 
+ * + * string content = 1; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The content to be echoed by the server.
+     * 
+ * + * string content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + /** + *
+     * The content to be echoed by the server.
+     * 
+ * + * string content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + return this; + } + /** + *
+     * The content to be echoed by the server.
+     * 
+ * + * string content = 1; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && + response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value).buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + /** + *
+     * The error to be thrown by the server.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged();; + return errorBuilder_; + } + + private int severity_ = 0; + /** + *
+     * The severity to be echoed by the server.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override public int getSeverityValue() { + return severity_; + } + /** + *
+     * The severity to be echoed by the server.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * The severity to be echoed by the server.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + /** + *
+     * The severity to be echoed by the server.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The severity to be echoed by the server.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object header_ = ""; + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string header = 4; + * @return The header. + */ + public java.lang.String getHeader() { + java.lang.Object ref = header_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + header_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string header = 4; + * @return The bytes for header. + */ + public com.google.protobuf.ByteString + getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string header = 4; + * @param value The header to set. + * @return This builder for chaining. + */ + public Builder setHeader( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + header_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string header = 4; + * @return This builder for chaining. + */ + public Builder clearHeader() { + + header_ = getDefaultInstance().getHeader(); + onChanged(); + return this; + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string header = 4; + * @param value The bytes for header to set. + * @return This builder for chaining. + */ + public Builder setHeaderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + header_ = value; + onChanged(); + return this; + } + + private java.lang.Object otherHeader_ = ""; + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string other_header = 5; + * @return The otherHeader. + */ + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherHeader_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string other_header = 5; + * @return The bytes for otherHeader. + */ + public com.google.protobuf.ByteString + getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string other_header = 5; + * @param value The otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeader( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + otherHeader_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string other_header = 5; + * @return This builder for chaining. + */ + public Builder clearOtherHeader() { + + otherHeader_ = getDefaultInstance().getOtherHeader(); + onChanged(); + return this; + } + /** + *
+     * Optional. This field can be set to test the routing annotation on the Echo method.
+     * 
+ * + * string other_header = 5; + * @param value The bytes for otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeaderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + otherHeader_ = 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.showcase.v1beta1.EchoRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoRequest) + private static final com.google.showcase.v1beta1.EchoRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoRequest(); + } + + public static com.google.showcase.v1beta1.EchoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoRequest(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.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java new file mode 100644 index 0000000000..08bd7d605f --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java @@ -0,0 +1,126 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The content to be echoed by the server.
+   * 
+ * + * string content = 1; + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + *
+   * The content to be echoed by the server.
+   * 
+ * + * string content = 1; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * The content to be echoed by the server.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + *
+   * The error to be thrown by the server.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + boolean hasError(); + /** + *
+   * The error to be thrown by the server.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + com.google.rpc.Status getError(); + /** + *
+   * The error to be thrown by the server.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + *
+   * The severity to be echoed by the server.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + *
+   * The severity to be echoed by the server.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 3; + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string header = 4; + * @return The header. + */ + java.lang.String getHeader(); + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string header = 4; + * @return The bytes for header. + */ + com.google.protobuf.ByteString + getHeaderBytes(); + + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string other_header = 5; + * @return The otherHeader. + */ + java.lang.String getOtherHeader(); + /** + *
+   * Optional. This field can be set to test the routing annotation on the Echo method.
+   * 
+ * + * string other_header = 5; + * @return The bytes for otherHeader. + */ + com.google.protobuf.ByteString + getOtherHeaderBytes(); + + public com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java new file mode 100644 index 0000000000..7173d88f4b --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java @@ -0,0 +1,719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response message for the Echo methods.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ +public final class EchoResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoResponse) + EchoResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use EchoResponse.newBuilder() to construct. + private EchoResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EchoResponse() { + content_ = ""; + severity_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EchoResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EchoResponse( + 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(); + + content_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + severity_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + *
+   * The content specified in the request.
+   * 
+ * + * string content = 1; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+   * The content specified in the request.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + *
+   * The severity specified in the request.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override public int getSeverityValue() { + return severity_; + } + /** + *
+   * The severity specified in the request.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return The severity. + */ + @java.lang.Override public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(2, severity_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, severity_); + } + 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.showcase.v1beta1.EchoResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoResponse other = (com.google.showcase.v1beta1.EchoResponse) obj; + + if (!getContent() + .equals(other.getContent())) return false; + if (severity_ != other.severity_) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse 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; + } + /** + *
+   * The response message for the Echo methods.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoResponse) + com.google.showcase.v1beta1.EchoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoResponse.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(); + content_ = ""; + + severity_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse build() { + com.google.showcase.v1beta1.EchoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse buildPartial() { + com.google.showcase.v1beta1.EchoResponse result = new com.google.showcase.v1beta1.EchoResponse(this); + result.content_ = content_; + result.severity_ = severity_; + 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.showcase.v1beta1.EchoResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoResponse other) { + if (other == com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + 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.showcase.v1beta1.EchoResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EchoResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+     * The content specified in the request.
+     * 
+ * + * string content = 1; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The content specified in the request.
+     * 
+ * + * string content = 1; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The content specified in the request.
+     * 
+ * + * string content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * The content specified in the request.
+     * 
+ * + * string content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+     * The content specified in the request.
+     * 
+ * + * string content = 1; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + *
+     * The severity specified in the request.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override public int getSeverityValue() { + return severity_; + } + /** + *
+     * The severity specified in the request.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * The severity specified in the request.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + /** + *
+     * The severity specified in the request.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The severity specified in the request.
+     * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 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.showcase.v1beta1.EchoResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoResponse) + private static final com.google.showcase.v1beta1.EchoResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoResponse(); + } + + public static com.google.showcase.v1beta1.EchoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoResponse(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.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java new file mode 100644 index 0000000000..5f4e56f2df --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java @@ -0,0 +1,48 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The content specified in the request.
+   * 
+ * + * string content = 1; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * The content specified in the request.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + *
+   * The severity specified in the request.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + *
+   * The severity specified in the request.
+   * 
+ * + * .google.showcase.v1beta1.Severity severity = 2; + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java new file mode 100644 index 0000000000..a24e5e4b9a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java @@ -0,0 +1,502 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.EnumRequest} + */ +public final class EnumRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumRequest) + EnumRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use EnumRequest.newBuilder() to construct. + private EnumRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EnumRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EnumRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EnumRequest( + 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 8: { + + unknownEnum_ = 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.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + public static final int UNKNOWN_ENUM_FIELD_NUMBER = 1; + private boolean unknownEnum_; + /** + *
+   * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
+   * 
+ * + * bool unknown_enum = 1; + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + 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 (unknownEnum_ != false) { + output.writeBool(1, unknownEnum_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (unknownEnum_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, unknownEnum_); + } + 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.showcase.v1beta1.EnumRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumRequest other = (com.google.showcase.v1beta1.EnumRequest) obj; + + if (getUnknownEnum() + != other.getUnknownEnum()) 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) + UNKNOWN_ENUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUnknownEnum()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.EnumRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumRequest) + com.google.showcase.v1beta1.EnumRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumRequest.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(); + unknownEnum_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest build() { + com.google.showcase.v1beta1.EnumRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest buildPartial() { + com.google.showcase.v1beta1.EnumRequest result = new com.google.showcase.v1beta1.EnumRequest(this); + result.unknownEnum_ = unknownEnum_; + 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.showcase.v1beta1.EnumRequest) { + return mergeFrom((com.google.showcase.v1beta1.EnumRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumRequest other) { + if (other == com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) return this; + if (other.getUnknownEnum() != false) { + setUnknownEnum(other.getUnknownEnum()); + } + 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.showcase.v1beta1.EnumRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EnumRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean unknownEnum_ ; + /** + *
+     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
+     * 
+ * + * bool unknown_enum = 1; + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + /** + *
+     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
+     * 
+ * + * bool unknown_enum = 1; + * @param value The unknownEnum to set. + * @return This builder for chaining. + */ + public Builder setUnknownEnum(boolean value) { + + unknownEnum_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
+     * 
+ * + * bool unknown_enum = 1; + * @return This builder for chaining. + */ + public Builder clearUnknownEnum() { + + unknownEnum_ = 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.showcase.v1beta1.EnumRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumRequest) + private static final com.google.showcase.v1beta1.EnumRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumRequest(); + } + + public static com.google.showcase.v1beta1.EnumRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumRequest(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.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java new file mode 100644 index 0000000000..2b83d2ac25 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java @@ -0,0 +1,19 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface EnumRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
+   * 
+ * + * bool unknown_enum = 1; + * @return The unknownEnum. + */ + boolean getUnknownEnum(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java new file mode 100644 index 0000000000..d3908f7a0b --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java @@ -0,0 +1,781 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.EnumResponse} + */ +public final class EnumResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumResponse) + EnumResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use EnumResponse.newBuilder() to construct. + private EnumResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EnumResponse() { + continent_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EnumResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EnumResponse( + 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.showcase.v1beta1.EnumRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(com.google.showcase.v1beta1.EnumRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + continent_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EnumRequest request_; + /** + *
+   * The original request for a known or unknown enum from the server.
+   * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + *
+   * The original request for a known or unknown enum from the server.
+   * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getRequest() { + return request_ == null ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() : request_; + } + /** + *
+   * The original request for a known or unknown enum from the server.
+   * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int CONTINENT_FIELD_NUMBER = 2; + private int continent_; + /** + *
+   * The actual enum the server provided.
+   * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override public int getContinentValue() { + return continent_; + } + /** + *
+   * The actual enum the server provided.
+   * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return The continent. + */ + @java.lang.Override public com.google.showcase.v1beta1.Continent getContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, continent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, continent_); + } + 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.showcase.v1beta1.EnumResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumResponse other = (com.google.showcase.v1beta1.EnumResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (continent_ != other.continent_) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + continent_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.EnumResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumResponse) + com.google.showcase.v1beta1.EnumResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumResponse.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 (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + continent_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse build() { + com.google.showcase.v1beta1.EnumResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse buildPartial() { + com.google.showcase.v1beta1.EnumResponse result = new com.google.showcase.v1beta1.EnumResponse(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + result.continent_ = continent_; + 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.showcase.v1beta1.EnumResponse) { + return mergeFrom((com.google.showcase.v1beta1.EnumResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumResponse other) { + if (other == com.google.showcase.v1beta1.EnumResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.continent_ != 0) { + setContinentValue(other.getContinentValue()); + } + 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.showcase.v1beta1.EnumResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EnumResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.EnumRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumRequest.Builder, com.google.showcase.v1beta1.EnumRequestOrBuilder> requestBuilder_; + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + * @return The request. + */ + public com.google.showcase.v1beta1.EnumRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest( + com.google.showcase.v1beta1.EnumRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + com.google.showcase.v1beta1.EnumRequest.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() : request_; + } + } + /** + *
+     * The original request for a known or unknown enum from the server.
+     * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumRequest.Builder, com.google.showcase.v1beta1.EnumRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumRequest.Builder, com.google.showcase.v1beta1.EnumRequestOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + + private int continent_ = 0; + /** + *
+     * The actual enum the server provided.
+     * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override public int getContinentValue() { + return continent_; + } + /** + *
+     * The actual enum the server provided.
+     * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @param value The enum numeric value on the wire for continent to set. + * @return This builder for chaining. + */ + public Builder setContinentValue(int value) { + + continent_ = value; + onChanged(); + return this; + } + /** + *
+     * The actual enum the server provided.
+     * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + /** + *
+     * The actual enum the server provided.
+     * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @param value The continent to set. + * @return This builder for chaining. + */ + public Builder setContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + + continent_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The actual enum the server provided.
+     * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return This builder for chaining. + */ + public Builder clearContinent() { + + continent_ = 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.showcase.v1beta1.EnumResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumResponse) + private static final com.google.showcase.v1beta1.EnumResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumResponse(); + } + + public static com.google.showcase.v1beta1.EnumResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumResponse(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.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java new file mode 100644 index 0000000000..d202a6d4e6 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface EnumResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The original request for a known or unknown enum from the server.
+   * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + *
+   * The original request for a known or unknown enum from the server.
+   * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + * @return The request. + */ + com.google.showcase.v1beta1.EnumRequest getRequest(); + /** + *
+   * The original request for a known or unknown enum from the server.
+   * 
+ * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder(); + + /** + *
+   * The actual enum the server provided.
+   * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return The enum numeric value on the wire for continent. + */ + int getContinentValue(); + /** + *
+   * The actual enum the server provided.
+   * 
+ * + * .google.showcase.v1beta1.Continent continent = 2; + * @return The continent. + */ + com.google.showcase.v1beta1.Continent getContinent(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java new file mode 100644 index 0000000000..0ced33e1c2 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java @@ -0,0 +1,831 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the Expand method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ +public final class ExpandRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ExpandRequest) + ExpandRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ExpandRequest.newBuilder() to construct. + private ExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExpandRequest() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ExpandRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExpandRequest( + 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(); + + content_ = s; + break; + } + case 18: { + com.google.rpc.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + *
+   * The content that will be split into words and returned on the stream.
+   * 
+ * + * string content = 1; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+   * The content that will be split into words and returned on the stream.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + private com.google.rpc.Status error_; + /** + *
+   * The error that is thrown after all words are sent on the stream.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + *
+   * The error that is thrown after all words are sent on the stream.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + *
+   * The error that is thrown after all words are sent on the stream.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (error_ != null) { + output.writeMessage(2, getError()); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getError()); + } + 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.showcase.v1beta1.ExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ExpandRequest other = (com.google.showcase.v1beta1.ExpandRequest) obj; + + if (!getContent() + .equals(other.getContent())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError() + .equals(other.getError())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest 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; + } + /** + *
+   * The request message for the Expand method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ExpandRequest) + com.google.showcase.v1beta1.ExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ExpandRequest.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(); + content_ = ""; + + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest build() { + com.google.showcase.v1beta1.ExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest buildPartial() { + com.google.showcase.v1beta1.ExpandRequest result = new com.google.showcase.v1beta1.ExpandRequest(this); + result.content_ = content_; + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.ExpandRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ExpandRequest other) { + if (other == com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + 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.showcase.v1beta1.ExpandRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ExpandRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+     * The content that will be split into words and returned on the stream.
+     * 
+ * + * string content = 1; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The content that will be split into words and returned on the stream.
+     * 
+ * + * string content = 1; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The content that will be split into words and returned on the stream.
+     * 
+ * + * string content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * The content that will be split into words and returned on the stream.
+     * 
+ * + * string content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+     * The content that will be split into words and returned on the stream.
+     * 
+ * + * string content = 1; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? + com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + *
+     * The error that is thrown after all words are sent on the stream.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getError(), + getParentForChildren(), + isClean()); + error_ = null; + } + return errorBuilder_; + } + @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.showcase.v1beta1.ExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ExpandRequest) + private static final com.google.showcase.v1beta1.ExpandRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ExpandRequest(); + } + + public static com.google.showcase.v1beta1.ExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExpandRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExpandRequest(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.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java new file mode 100644 index 0000000000..3286ec98c7 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface ExpandRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The content that will be split into words and returned on the stream.
+   * 
+ * + * string content = 1; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * The content that will be split into words and returned on the stream.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + *
+   * The error that is thrown after all words are sent on the stream.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + boolean hasError(); + /** + *
+   * The error that is thrown after all words are sent on the stream.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + com.google.rpc.Status getError(); + /** + *
+   * The error that is thrown after all words are sent on the stream.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java new file mode 100644 index 0000000000..0080047610 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ +public final class GetBlurbRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetBlurbRequest) + GetBlurbRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetBlurbRequest.newBuilder() to construct. + private GetBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetBlurbRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetBlurbRequest( + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * 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.showcase.v1beta1.GetBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetBlurbRequest other = (com.google.showcase.v1beta1.GetBlurbRequest) 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.showcase.v1beta1.GetBlurbRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetBlurbRequest) + com.google.showcase.v1beta1.GetBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetBlurbRequest.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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest build() { + com.google.showcase.v1beta1.GetBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest buildPartial() { + com.google.showcase.v1beta1.GetBlurbRequest result = new com.google.showcase.v1beta1.GetBlurbRequest(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.showcase.v1beta1.GetBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetBlurbRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetBlurbRequest other) { + if (other == com.google.showcase.v1beta1.GetBlurbRequest.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.showcase.v1beta1.GetBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested blurb.
+     * 
+ * + * 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.showcase.v1beta1.GetBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetBlurbRequest) + private static final com.google.showcase.v1beta1.GetBlurbRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetBlurbRequest(); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBlurbRequest(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.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..0d6d925511 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface GetBlurbRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the requested blurb.
+   * 
+ * + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java new file mode 100644 index 0000000000..742722b6cb --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\GetRoom
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ +public final class GetRoomRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetRoomRequest) + GetRoomRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetRoomRequest.newBuilder() to construct. + private GetRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetRoomRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetRoomRequest( + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * 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.showcase.v1beta1.GetRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetRoomRequest other = (com.google.showcase.v1beta1.GetRoomRequest) 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.showcase.v1beta1.GetRoomRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\GetRoom
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetRoomRequest) + com.google.showcase.v1beta1.GetRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetRoomRequest.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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest build() { + com.google.showcase.v1beta1.GetRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest buildPartial() { + com.google.showcase.v1beta1.GetRoomRequest result = new com.google.showcase.v1beta1.GetRoomRequest(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.showcase.v1beta1.GetRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetRoomRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetRoomRequest other) { + if (other == com.google.showcase.v1beta1.GetRoomRequest.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.showcase.v1beta1.GetRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested room.
+     * 
+ * + * 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.showcase.v1beta1.GetRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetRoomRequest) + private static final com.google.showcase.v1beta1.GetRoomRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetRoomRequest(); + } + + public static com.google.showcase.v1beta1.GetRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetRoomRequest(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.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java new file mode 100644 index 0000000000..72da927362 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface GetRoomRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the requested room.
+   * 
+ * + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java new file mode 100644 index 0000000000..9864b1d455 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} + */ +public final class GetSequenceReportRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSequenceReportRequest) + GetSequenceReportRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetSequenceReportRequest.newBuilder() to construct. + private GetSequenceReportRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetSequenceReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetSequenceReportRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetSequenceReportRequest( + 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.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * 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; + } + } + /** + * 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.showcase.v1beta1.GetSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSequenceReportRequest other = (com.google.showcase.v1beta1.GetSequenceReportRequest) 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.showcase.v1beta1.GetSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSequenceReportRequest.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.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest build() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = new com.google.showcase.v1beta1.GetSequenceReportRequest(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.showcase.v1beta1.GetSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSequenceReportRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSequenceReportRequest other) { + if (other == com.google.showcase.v1beta1.GetSequenceReportRequest.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.showcase.v1beta1.GetSequenceReportRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetSequenceReportRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * 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; + } + } + /** + * 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; + } + } + /** + * 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; + } + /** + * 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; + } + /** + * 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.showcase.v1beta1.GetSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetSequenceReportRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSequenceReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSequenceReportRequest(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.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..e8f9cb6049 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface GetSequenceReportRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java new file mode 100644 index 0000000000..eaf565f7c4 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for the GetSession method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ +public final class GetSessionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSessionRequest) + GetSessionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetSessionRequest.newBuilder() to construct. + private GetSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetSessionRequest( + 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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The session to be retrieved.
+   * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+   * The session to be retrieved.
+   * 
+ * + * string name = 1 [(.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.showcase.v1beta1.GetSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSessionRequest other = (com.google.showcase.v1beta1.GetSessionRequest) 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.showcase.v1beta1.GetSessionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest 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; + } + /** + *
+   * The request for the GetSession method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSessionRequest) + com.google.showcase.v1beta1.GetSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSessionRequest.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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest build() { + com.google.showcase.v1beta1.GetSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest buildPartial() { + com.google.showcase.v1beta1.GetSessionRequest result = new com.google.showcase.v1beta1.GetSessionRequest(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.showcase.v1beta1.GetSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSessionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSessionRequest other) { + if (other == com.google.showcase.v1beta1.GetSessionRequest.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.showcase.v1beta1.GetSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The session to be retrieved.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The session to be retrieved.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The session to be retrieved.
+     * 
+ * + * string name = 1 [(.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; + } + /** + *
+     * The session to be retrieved.
+     * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The session to be retrieved.
+     * 
+ * + * string name = 1 [(.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.showcase.v1beta1.GetSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSessionRequest) + private static final com.google.showcase.v1beta1.GetSessionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSessionRequest(); + } + + public static com.google.showcase.v1beta1.GetSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSessionRequest(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.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java new file mode 100644 index 0000000000..b51b769709 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface GetSessionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The session to be retrieved.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The session to be retrieved.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java new file mode 100644 index 0000000000..8f950d71af --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Identity\GetUser
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ +public final class GetUserRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetUserRequest) + GetUserRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetUserRequest( + 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.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the requested user.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the requested user.
+   * 
+ * + * 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.showcase.v1beta1.GetUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetUserRequest other = (com.google.showcase.v1beta1.GetUserRequest) 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.showcase.v1beta1.GetUserRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Identity\GetUser
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetUserRequest) + com.google.showcase.v1beta1.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetUserRequest.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.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest build() { + com.google.showcase.v1beta1.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest buildPartial() { + com.google.showcase.v1beta1.GetUserRequest result = new com.google.showcase.v1beta1.GetUserRequest(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.showcase.v1beta1.GetUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetUserRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetUserRequest other) { + if (other == com.google.showcase.v1beta1.GetUserRequest.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.showcase.v1beta1.GetUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the requested user.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested user.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested user.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested user.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested user.
+     * 
+ * + * 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.showcase.v1beta1.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetUserRequest) + private static final com.google.showcase.v1beta1.GetUserRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetUserRequest(); + } + + public static com.google.showcase.v1beta1.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetUserRequest(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.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java new file mode 100644 index 0000000000..d701822965 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface GetUserRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the requested user.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the requested user.
+   * 
+ * + * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java new file mode 100644 index 0000000000..2e42ad5a01 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java @@ -0,0 +1,187 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public final class IdentityOuterClass { + private IdentityOuterClass() {} + 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_showcase_v1beta1_User_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_User_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n-schema/google/showcase/v1beta1/identit" + + "y.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\033google/prot" + + "obuf/empty.proto\032 google/protobuf/field_" + + "mask.proto\032\037google/protobuf/timestamp.pr" + + "oto\"\204\003\n\004User\022\014\n\004name\030\001 \001(\t\022\031\n\014display_na" + + "me\030\002 \001(\tB\003\340A\002\022\022\n\005email\030\003 \001(\tB\003\340A\002\0224\n\013cre" + + "ate_time\030\004 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\0224\n\013update_time\030\005 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\022\020\n\003age\030\006 \001(\005H\000\210\001\001\022" + + "\030\n\013height_feet\030\007 \001(\001H\001\210\001\001\022\025\n\010nickname\030\010 " + + "\001(\tH\002\210\001\001\022!\n\024enable_notifications\030\t \001(\010H\003" + + "\210\001\001:/\352A,\n\034showcase.googleapis.com/User\022\014" + + "users/{user}B\006\n\004_ageB\016\n\014_height_feetB\013\n\t" + + "_nicknameB\027\n\025_enable_notifications\"@\n\021Cr" + + "eateUserRequest\022+\n\004user\030\001 \001(\0132\035.google.s" + + "howcase.v1beta1.User\"D\n\016GetUserRequest\0222" + + "\n\004name\030\001 \001(\tB$\372A\036\n\034showcase.googleapis.c" + + "om/User\340A\002\"q\n\021UpdateUserRequest\022+\n\004user\030" + + "\001 \001(\0132\035.google.showcase.v1beta1.User\022/\n\013" + + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + + "dMask\"G\n\021DeleteUserRequest\0222\n\004name\030\001 \001(\t" + + "B$\372A\036\n\034showcase.googleapis.com/User\340A\002\"9" + + "\n\020ListUsersRequest\022\021\n\tpage_size\030\001 \001(\005\022\022\n" + + "\npage_token\030\002 \001(\t\"Z\n\021ListUsersResponse\022," + + "\n\005users\030\001 \003(\0132\035.google.showcase.v1beta1." + + "User\022\027\n\017next_page_token\030\002 \001(\t2\212\006\n\010Identi" + + "ty\022\363\001\n\nCreateUser\022*.google.showcase.v1be" + + "ta1.CreateUserRequest\032\035.google.showcase." + + "v1beta1.User\"\231\001\202\323\344\223\002\023\"\016/v1beta1/users:\001*" + + "\332A\034user.display_name,user.email\332A^user.d" + + "isplay_name,user.email,user.age,user.nic" + + "kname,user.enable_notifications,user.hei" + + "ght_feet\022y\n\007GetUser\022\'.google.showcase.v1" + + "beta1.GetUserRequest\032\035.google.showcase.v" + + "1beta1.User\"&\202\323\344\223\002\031\022\027/v1beta1/{name=user" + + "s/*}\332A\004name\022\203\001\n\nUpdateUser\022*.google.show" + + "case.v1beta1.UpdateUserRequest\032\035.google." + + "showcase.v1beta1.User\"*\202\323\344\223\002$2\034/v1beta1/" + + "{user.name=users/*}:\004user\022x\n\nDeleteUser\022" + + "*.google.showcase.v1beta1.DeleteUserRequ" + + "est\032\026.google.protobuf.Empty\"&\202\323\344\223\002\031*\027/v1" + + "beta1/{name=users/*}\332A\004name\022z\n\tListUsers" + + "\022).google.showcase.v1beta1.ListUsersRequ" + + "est\032*.google.showcase.v1beta1.ListUsersR" + + "esponse\"\026\202\323\344\223\002\020\022\016/v1beta1/users\032\021\312A\016loca" + + "lhost:7469Bq\n\033com.google.showcase.v1beta" + + "1P\001Z4github.com/googleapis/gapic-showcas" + + "e/server/genproto\352\002\031Google::Showcase::V1" + + "beta1b\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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_User_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_User_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_User_descriptor, + new java.lang.String[] { "Name", "DisplayName", "Email", "CreateTime", "UpdateTime", "Age", "HeightFeet", "Nickname", "EnableNotifications", "Age", "HeightFeet", "Nickname", "EnableNotifications", }); + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor, + new java.lang.String[] { "User", }); + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor, + new java.lang.String[] { "User", "UpdateMask", }); + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor, + new java.lang.String[] { "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor, + new java.lang.String[] { "Users", "NextPageToken", }); + 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.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + 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.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java new file mode 100644 index 0000000000..685fb2c112 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java @@ -0,0 +1,1136 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * An issue found in the test.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ +public final class Issue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Issue) + IssueOrBuilder { +private static final long serialVersionUID = 0L; + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Issue() { + type_ = 0; + severity_ = 0; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Issue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Issue( + 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 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = 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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, com.google.showcase.v1beta1.Issue.Builder.class); + } + + /** + *
+   * The different potential types of issues.
+   * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + *
+     * The test was never instrumented.
+     * 
+ * + * SKIPPED = 1; + */ + SKIPPED(1), + /** + *
+     * The test was started but never confirmed.
+     * 
+ * + * PENDING = 2; + */ + PENDING(2), + /** + *
+     * The test was instrumented, but Showcase got an unexpected
+     * value when the generator tried to confirm success.
+     * 
+ * + * INCORRECT_CONFIRMATION = 3; + */ + INCORRECT_CONFIRMATION(3), + UNRECOGNIZED(-1), + ; + + /** + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * The test was never instrumented.
+     * 
+ * + * SKIPPED = 1; + */ + public static final int SKIPPED_VALUE = 1; + /** + *
+     * The test was started but never confirmed.
+     * 
+ * + * PENDING = 2; + */ + public static final int PENDING_VALUE = 2; + /** + *
+     * The test was instrumented, but Showcase got an unexpected
+     * value when the generator tried to confirm success.
+     * 
+ * + * INCORRECT_CONFIRMATION = 3; + */ + public static final int INCORRECT_CONFIRMATION_VALUE = 3; + + + 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 SKIPPED; + case 2: return PENDING; + case 3: return INCORRECT_CONFIRMATION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> 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.showcase.v1beta1.Issue.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.showcase.v1beta1.Issue.Type) + } + + /** + *
+   * Severity levels.
+   * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Severity} + */ + public enum Severity + implements com.google.protobuf.ProtocolMessageEnum { + /** + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + *
+     * Errors.
+     * 
+ * + * ERROR = 1; + */ + ERROR(1), + /** + *
+     * Warnings.
+     * 
+ * + * WARNING = 2; + */ + WARNING(2), + UNRECOGNIZED(-1), + ; + + /** + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + *
+     * Errors.
+     * 
+ * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + /** + *
+     * Warnings.
+     * 
+ * + * WARNING = 2; + */ + public static final int WARNING_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: return SEVERITY_UNSPECIFIED; + case 1: return ERROR; + case 2: return WARNING; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Severity> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(1); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Severity) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+   * The type of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
+   * The type of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return The type. + */ + @java.lang.Override public com.google.showcase.v1beta1.Issue.Type getType() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Type result = com.google.showcase.v1beta1.Issue.Type.valueOf(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + *
+   * The severity of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override public int getSeverityValue() { + return severity_; + } + /** + *
+   * The severity of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return The severity. + */ + @java.lang.Override public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Severity result = com.google.showcase.v1beta1.Issue.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+   * A description of the issue.
+   * 
+ * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * A description of the issue.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + 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.showcase.v1beta1.Issue)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Issue other = (com.google.showcase.v1beta1.Issue) obj; + + if (type_ != other.type_) return false; + if (severity_ != other.severity_) return false; + if (!getDescription() + .equals(other.getDescription())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Issue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Issue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Issue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Issue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue 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; + } + /** + *
+   * An issue found in the test.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Issue) + com.google.showcase.v1beta1.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, com.google.showcase.v1beta1.Issue.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Issue.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(); + type_ = 0; + + severity_ = 0; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Issue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue build() { + com.google.showcase.v1beta1.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue buildPartial() { + com.google.showcase.v1beta1.Issue result = new com.google.showcase.v1beta1.Issue(this); + result.type_ = type_; + result.severity_ = severity_; + result.description_ = description_; + 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.showcase.v1beta1.Issue) { + return mergeFrom((com.google.showcase.v1beta1.Issue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Issue other) { + if (other == com.google.showcase.v1beta1.Issue.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + 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.showcase.v1beta1.Issue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Issue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + *
+     * The type of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
+     * The type of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @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; + } + /** + *
+     * The type of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Type result = com.google.showcase.v1beta1.Issue.Type.valueOf(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + /** + *
+     * The type of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.showcase.v1beta1.Issue.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The type of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + *
+     * The severity of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override public int getSeverityValue() { + return severity_; + } + /** + *
+     * The severity of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * The severity of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Severity result = com.google.showcase.v1beta1.Issue.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + /** + *
+     * The severity of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Issue.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The severity of the issue.
+     * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * A description of the issue.
+     * 
+ * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A description of the issue.
+     * 
+ * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A description of the issue.
+     * 
+ * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * A description of the issue.
+     * 
+ * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * A description of the issue.
+     * 
+ * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Issue) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Issue) + private static final com.google.showcase.v1beta1.Issue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Issue(); + } + + public static com.google.showcase.v1beta1.Issue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Issue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Issue(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.showcase.v1beta1.Issue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java new file mode 100644 index 0000000000..4371799dce --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface IssueOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The type of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + *
+   * The type of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Type type = 1; + * @return The type. + */ + com.google.showcase.v1beta1.Issue.Type getType(); + + /** + *
+   * The severity of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + *
+   * The severity of the issue.
+   * 
+ * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * @return The severity. + */ + com.google.showcase.v1beta1.Issue.Severity getSeverity(); + + /** + *
+   * A description of the issue.
+   * 
+ * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * A description of the issue.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java new file mode 100644 index 0000000000..1bf87e7a26 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java @@ -0,0 +1,865 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ +public final class ListBlurbsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsRequest) + ListBlurbsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListBlurbsRequest.newBuilder() to construct. + private ListBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListBlurbsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListBlurbsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListBlurbsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The resource name of the requested room or profile whos blurbs to list.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of the requested room or profile whos blurbs to list.
+   * 
+ * + * 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_; + /** + *
+   * The maximum number of blurbs to return. Server may return fewer
+   * blurbs than requested. If unspecified, server will pick an appropriate
+   * default.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsRequest other = (com.google.showcase.v1beta1.ListBlurbsRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsRequest) + com.google.showcase.v1beta1.ListBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest build() { + com.google.showcase.v1beta1.ListBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.ListBlurbsRequest result = new com.google.showcase.v1beta1.ListBlurbsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListBlurbsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListBlurbsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The resource name of the requested room or profile whos blurbs to list.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested room or profile whos blurbs to list.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of the requested room or profile whos blurbs to list.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested room or profile whos blurbs to list.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of the requested room or profile whos blurbs to list.
+     * 
+ * + * 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_ ; + /** + *
+     * The maximum number of blurbs to return. Server may return fewer
+     * blurbs than requested. If unspecified, server will pick an appropriate
+     * default.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of blurbs to return. Server may return fewer
+     * blurbs than requested. If unspecified, server will pick an appropriate
+     * default.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of blurbs to return. Server may return fewer
+     * blurbs than requested. If unspecified, server will pick an appropriate
+     * default.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsRequest) + private static final com.google.showcase.v1beta1.ListBlurbsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBlurbsRequest(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.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..4333751fab --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListBlurbsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the requested room or profile whos blurbs to list.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * The resource name of the requested room or profile whos blurbs to list.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of blurbs to return. Server may return fewer
+   * blurbs than requested. If unspecified, server will pick an appropriate
+   * default.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java new file mode 100644 index 0000000000..65e8c54f4b --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java @@ -0,0 +1,1061 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ +public final class ListBlurbsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsResponse) + ListBlurbsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListBlurbsResponse.newBuilder() to construct. + private ListBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListBlurbsResponse( + 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)) { + blurbs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + blurbs_.add( + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + private java.util.List blurbs_; + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( + int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+   * the next page of results.
+   * 
+ * + * 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 next page of results.
+   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+   * the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsResponse other = (com.google.showcase.v1beta1.ListBlurbsResponse) obj; + + if (!getBlurbsList() + .equals(other.getBlurbsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse 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; + } + /** + *
+   * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsResponse) + com.google.showcase.v1beta1.ListBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getBlurbsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + blurbsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse build() { + com.google.showcase.v1beta1.ListBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.ListBlurbsResponse result = new com.google.showcase.v1beta1.ListBlurbsResponse(this); + int from_bitField0_ = bitField0_; + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance()) return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBlurbsFieldBuilder() : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List blurbs_ = + java.util.Collections.emptyList(); + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbsBuilder_; + + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs( + int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs( + int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs( + int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs( + com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs( + int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder( + int index) { + return getBlurbsFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( + int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return getBlurbsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder( + int index) { + return getBlurbsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + /** + *
+     * The list of blurbs.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsBuilderList() { + return getBlurbsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+     * the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+     * the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+     * the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+     * the next page of results.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+     * the next page of results.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsResponse) + private static final com.google.showcase.v1beta1.ListBlurbsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBlurbsResponse(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.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..45fe6f1c9f --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListBlurbsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List + getBlurbsList(); + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List + getBlurbsOrBuilderList(); + /** + *
+   * The list of blurbs.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+   * the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
+   * the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java new file mode 100644 index 0000000000..379feac0dc --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java @@ -0,0 +1,695 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\ListRooms
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ +public final class ListRoomsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsRequest) + ListRoomsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListRoomsRequest.newBuilder() to construct. + private ListRoomsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListRoomsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListRoomsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListRoomsRequest( + 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 8: { + + pageSize_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + /** + *
+   * The maximum number of rooms return. Server may return fewer rooms
+   * than requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListRooms` method.
+   * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListRooms` method.
+   * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListRoomsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsRequest other = (com.google.showcase.v1beta1.ListRoomsRequest) obj; + + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\ListRooms
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsRequest) + com.google.showcase.v1beta1.ListRoomsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsRequest.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(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest build() { + com.google.showcase.v1beta1.ListRoomsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest buildPartial() { + com.google.showcase.v1beta1.ListRoomsRequest result = new com.google.showcase.v1beta1.ListRoomsRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListRoomsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsRequest other) { + if (other == com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance()) return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListRoomsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListRoomsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of rooms return. Server may return fewer rooms
+     * than requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of rooms return. Server may return fewer rooms
+     * than requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 1; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of rooms return. Server may return fewer rooms
+     * than requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 1; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListRooms` method.
+     * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListRooms` method.
+     * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListRooms` method.
+     * 
+ * + * string page_token = 2; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListRooms` method.
+     * 
+ * + * string page_token = 2; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\ListRooms` method.
+     * 
+ * + * string page_token = 2; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsRequest) + private static final com.google.showcase.v1beta1.ListRoomsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsRequest(); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRoomsRequest(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.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java new file mode 100644 index 0000000000..b385d4e3bc --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListRoomsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The maximum number of rooms return. Server may return fewer rooms
+   * than requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListRooms` method.
+   * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\ListRooms` method.
+   * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java new file mode 100644 index 0000000000..647fdcf143 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java @@ -0,0 +1,1061 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response message for the google.showcase.v1beta1.Messaging\ListRooms
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ +public final class ListRoomsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsResponse) + ListRoomsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListRoomsResponse.newBuilder() to construct. + private ListRoomsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListRoomsResponse() { + rooms_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListRoomsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListRoomsResponse( + 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)) { + rooms_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rooms_.add( + input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rooms_ = java.util.Collections.unmodifiableList(rooms_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + public static final int ROOMS_FIELD_NUMBER = 1; + private java.util.List rooms_; + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List getRoomsList() { + return rooms_; + } + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List + getRoomsOrBuilderList() { + return rooms_; + } + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public int getRoomsCount() { + return rooms_.size(); + } + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRooms(int index) { + return rooms_.get(index); + } + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder( + int index) { + return rooms_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListRoomsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+   * the next page of results.
+   * 
+ * + * 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 next page of results.
+   * Pass this value in ListRoomsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+   * the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < rooms_.size(); i++) { + output.writeMessage(1, rooms_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rooms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, rooms_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListRoomsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsResponse other = (com.google.showcase.v1beta1.ListRoomsResponse) obj; + + if (!getRoomsList() + .equals(other.getRoomsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRoomsCount() > 0) { + hash = (37 * hash) + ROOMS_FIELD_NUMBER; + hash = (53 * hash) + getRoomsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse 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; + } + /** + *
+   * The response message for the google.showcase.v1beta1.Messaging\ListRooms
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsResponse) + com.google.showcase.v1beta1.ListRoomsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRoomsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + roomsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse build() { + com.google.showcase.v1beta1.ListRoomsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse buildPartial() { + com.google.showcase.v1beta1.ListRoomsResponse result = new com.google.showcase.v1beta1.ListRoomsResponse(this); + int from_bitField0_ = bitField0_; + if (roomsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rooms_ = java.util.Collections.unmodifiableList(rooms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rooms_ = rooms_; + } else { + result.rooms_ = roomsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListRoomsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsResponse other) { + if (other == com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance()) return this; + if (roomsBuilder_ == null) { + if (!other.rooms_.isEmpty()) { + if (rooms_.isEmpty()) { + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoomsIsMutable(); + rooms_.addAll(other.rooms_); + } + onChanged(); + } + } else { + if (!other.rooms_.isEmpty()) { + if (roomsBuilder_.isEmpty()) { + roomsBuilder_.dispose(); + roomsBuilder_ = null; + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + roomsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRoomsFieldBuilder() : null; + } else { + roomsBuilder_.addAllMessages(other.rooms_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListRoomsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListRoomsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List rooms_ = + java.util.Collections.emptyList(); + private void ensureRoomsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rooms_ = new java.util.ArrayList(rooms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> roomsBuilder_; + + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsList() { + if (roomsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rooms_); + } else { + return roomsBuilder_.getMessageList(); + } + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public int getRoomsCount() { + if (roomsBuilder_ == null) { + return rooms_.size(); + } else { + return roomsBuilder_.getCount(); + } + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room getRooms(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessage(index); + } + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms( + int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.set(index, value); + onChanged(); + } else { + roomsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms( + int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.set(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(value); + onChanged(); + } else { + roomsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms( + int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(index, value); + onChanged(); + } else { + roomsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms( + com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms( + int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addAllRooms( + java.lang.Iterable values) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, rooms_); + onChanged(); + } else { + roomsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder clearRooms() { + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + roomsBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder removeRooms(int index) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.remove(index); + onChanged(); + } else { + roomsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomsBuilder( + int index) { + return getRoomsFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder( + int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); } else { + return roomsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List + getRoomsOrBuilderList() { + if (roomsBuilder_ != null) { + return roomsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rooms_); + } + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder() { + return getRoomsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder( + int index) { + return getRoomsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + /** + *
+     * The list of rooms.
+     * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List + getRoomsBuilderList() { + return getRoomsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> + getRoomsFieldBuilder() { + if (roomsBuilder_ == null) { + roomsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder>( + rooms_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + rooms_ = null; + } + return roomsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in ListRoomsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+     * the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListRoomsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+     * the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListRoomsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+     * the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListRoomsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+     * the next page of results.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in ListRoomsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+     * the next page of results.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsResponse) + private static final com.google.showcase.v1beta1.ListRoomsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsResponse(); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRoomsResponse(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.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java new file mode 100644 index 0000000000..5ce50752b3 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListRoomsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List + getRoomsList(); + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.Room getRooms(int index); + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + int getRoomsCount(); + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List + getRoomsOrBuilderList(); + /** + *
+   * The list of rooms.
+   * 
+ * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListRoomsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+   * the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListRoomsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
+   * the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java new file mode 100644 index 0000000000..ed242c47e4 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java @@ -0,0 +1,675 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for the ListSessions method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ +public final class ListSessionsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsRequest) + ListSessionsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListSessionsRequest.newBuilder() to construct. + private ListSessionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListSessionsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListSessionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListSessionsRequest( + 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 8: { + + pageSize_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + /** + *
+   * The maximum number of sessions to return per page.
+   * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListSessionsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsRequest other = (com.google.showcase.v1beta1.ListSessionsRequest) obj; + + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest 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; + } + /** + *
+   * The request for the ListSessions method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsRequest) + com.google.showcase.v1beta1.ListSessionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsRequest.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(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest build() { + com.google.showcase.v1beta1.ListSessionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest buildPartial() { + com.google.showcase.v1beta1.ListSessionsRequest result = new com.google.showcase.v1beta1.ListSessionsRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListSessionsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsRequest other) { + if (other == com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance()) return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListSessionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListSessionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of sessions to return per page.
+     * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of sessions to return per page.
+     * 
+ * + * int32 page_size = 1; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of sessions to return per page.
+     * 
+ * + * int32 page_size = 1; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 2; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 2; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 2; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsRequest) + private static final com.google.showcase.v1beta1.ListSessionsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsRequest(); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSessionsRequest(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.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java new file mode 100644 index 0000000000..54042c6209 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListSessionsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The maximum number of sessions to return per page.
+   * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java new file mode 100644 index 0000000000..2ad961fbec --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java @@ -0,0 +1,1045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * Response for the ListSessions method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ +public final class ListSessionsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsResponse) + ListSessionsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListSessionsResponse.newBuilder() to construct. + private ListSessionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListSessionsResponse() { + sessions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListSessionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListSessionsResponse( + 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)) { + sessions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + sessions_.add( + input.readMessage(com.google.showcase.v1beta1.Session.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + public static final int SESSIONS_FIELD_NUMBER = 1; + private java.util.List sessions_; + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List getSessionsList() { + return sessions_; + } + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List + getSessionsOrBuilderList() { + return sessions_; + } + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public int getSessionsCount() { + return sessions_.size(); + } + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSessions(int index) { + return sessions_.get(index); + } + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder( + int index) { + return sessions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * 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; + } + } + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < sessions_.size(); i++) { + output.writeMessage(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sessions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListSessionsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsResponse other = (com.google.showcase.v1beta1.ListSessionsResponse) obj; + + if (!getSessionsList() + .equals(other.getSessionsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSessionsCount() > 0) { + hash = (37 * hash) + SESSIONS_FIELD_NUMBER; + hash = (53 * hash) + getSessionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse 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 for the ListSessions method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsResponse) + com.google.showcase.v1beta1.ListSessionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSessionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sessionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse build() { + com.google.showcase.v1beta1.ListSessionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse buildPartial() { + com.google.showcase.v1beta1.ListSessionsResponse result = new com.google.showcase.v1beta1.ListSessionsResponse(this); + int from_bitField0_ = bitField0_; + if (sessionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessions_ = sessions_; + } else { + result.sessions_ = sessionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListSessionsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsResponse other) { + if (other == com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance()) return this; + if (sessionsBuilder_ == null) { + if (!other.sessions_.isEmpty()) { + if (sessions_.isEmpty()) { + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionsIsMutable(); + sessions_.addAll(other.sessions_); + } + onChanged(); + } + } else { + if (!other.sessions_.isEmpty()) { + if (sessionsBuilder_.isEmpty()) { + sessionsBuilder_.dispose(); + sessionsBuilder_ = null; + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSessionsFieldBuilder() : null; + } else { + sessionsBuilder_.addAllMessages(other.sessions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListSessionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListSessionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List sessions_ = + java.util.Collections.emptyList(); + private void ensureSessionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessions_ = new java.util.ArrayList(sessions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> sessionsBuilder_; + + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsList() { + if (sessionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessions_); + } else { + return sessionsBuilder_.getMessageList(); + } + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public int getSessionsCount() { + if (sessionsBuilder_ == null) { + return sessions_.size(); + } else { + return sessionsBuilder_.getCount(); + } + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session getSessions(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessage(index); + } + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions( + int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.set(index, value); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(value); + onChanged(); + } else { + sessionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions( + int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(index, value); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions( + com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addAllSessions( + java.lang.Iterable values) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sessions_); + onChanged(); + } else { + sessionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder clearSessions() { + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionsBuilder_.clear(); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder removeSessions(int index) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.remove(index); + onChanged(); + } else { + sessionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionsBuilder( + int index) { + return getSessionsFieldBuilder().getBuilder(index); + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder( + int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); } else { + return sessionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List + getSessionsOrBuilderList() { + if (sessionsBuilder_ != null) { + return sessionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessions_); + } + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder() { + return getSessionsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder( + int index) { + return getSessionsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + /** + *
+     * The sessions being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List + getSessionsBuilderList() { + return getSessionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> + getSessionsFieldBuilder() { + if (sessionsBuilder_ == null) { + sessionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder>( + sessions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sessions_ = null; + } + return sessionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * 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; + } + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * 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; + } + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * 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; + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsResponse) + private static final com.google.showcase.v1beta1.ListSessionsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsResponse(); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSessionsResponse(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.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java new file mode 100644 index 0000000000..2dbaa51602 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListSessionsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List + getSessionsList(); + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.Session getSessions(int index); + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + int getSessionsCount(); + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List + getSessionsOrBuilderList(); + /** + *
+   * The sessions being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder( + int index); + + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java new file mode 100644 index 0000000000..90275331e6 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java @@ -0,0 +1,841 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for the ListTests method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ +public final class ListTestsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsRequest) + ListTestsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListTestsRequest.newBuilder() to construct. + private ListTestsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListTestsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListTestsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListTestsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The session.
+   * 
+ * + * string parent = 1 [(.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; + } + } + /** + *
+   * The session.
+   * 
+ * + * string parent = 1 [(.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_; + /** + *
+   * The maximum number of tests to return per page.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListTestsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsRequest other = (com.google.showcase.v1beta1.ListTestsRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest 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; + } + /** + *
+   * The request for the ListTests method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsRequest) + com.google.showcase.v1beta1.ListTestsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest build() { + com.google.showcase.v1beta1.ListTestsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest buildPartial() { + com.google.showcase.v1beta1.ListTestsRequest result = new com.google.showcase.v1beta1.ListTestsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListTestsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsRequest other) { + if (other == com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListTestsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListTestsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The session.
+     * 
+ * + * string parent = 1 [(.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; + } + } + /** + *
+     * The session.
+     * 
+ * + * string parent = 1 [(.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; + } + } + /** + *
+     * The session.
+     * 
+ * + * string parent = 1 [(.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; + } + /** + *
+     * The session.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The session.
+     * 
+ * + * string parent = 1 [(.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_ ; + /** + *
+     * The maximum number of tests to return per page.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of tests to return per page.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of tests to return per page.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The page token, for retrieving subsequent pages.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsRequest) + private static final com.google.showcase.v1beta1.ListTestsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsRequest(); + } + + public static com.google.showcase.v1beta1.ListTestsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTestsRequest(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.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java new file mode 100644 index 0000000000..be84bb6248 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListTestsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The session.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * The session.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of tests to return per page.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The page token, for retrieving subsequent pages.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java new file mode 100644 index 0000000000..7fa4dca4d8 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java @@ -0,0 +1,1045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response for the ListTests method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ +public final class ListTestsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsResponse) + ListTestsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListTestsResponse.newBuilder() to construct. + private ListTestsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListTestsResponse() { + tests_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListTestsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListTestsResponse( + 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)) { + tests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tests_.add( + input.readMessage(com.google.showcase.v1beta1.Test.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tests_ = java.util.Collections.unmodifiableList(tests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + public static final int TESTS_FIELD_NUMBER = 1; + private java.util.List tests_; + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List getTestsList() { + return tests_; + } + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List + getTestsOrBuilderList() { + return tests_; + } + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public int getTestsCount() { + return tests_.size(); + } + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test getTests(int index) { + return tests_.get(index); + } + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder( + int index) { + return tests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * 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; + } + } + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < tests_.size(); i++) { + output.writeMessage(1, tests_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tests_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListTestsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsResponse other = (com.google.showcase.v1beta1.ListTestsResponse) obj; + + if (!getTestsList() + .equals(other.getTestsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTestsCount() > 0) { + hash = (37 * hash) + TESTS_FIELD_NUMBER; + hash = (53 * hash) + getTestsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse 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; + } + /** + *
+   * The response for the ListTests method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsResponse) + com.google.showcase.v1beta1.ListTestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTestsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + testsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse build() { + com.google.showcase.v1beta1.ListTestsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse buildPartial() { + com.google.showcase.v1beta1.ListTestsResponse result = new com.google.showcase.v1beta1.ListTestsResponse(this); + int from_bitField0_ = bitField0_; + if (testsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tests_ = java.util.Collections.unmodifiableList(tests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tests_ = tests_; + } else { + result.tests_ = testsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListTestsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsResponse other) { + if (other == com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance()) return this; + if (testsBuilder_ == null) { + if (!other.tests_.isEmpty()) { + if (tests_.isEmpty()) { + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestsIsMutable(); + tests_.addAll(other.tests_); + } + onChanged(); + } + } else { + if (!other.tests_.isEmpty()) { + if (testsBuilder_.isEmpty()) { + testsBuilder_.dispose(); + testsBuilder_ = null; + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + testsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTestsFieldBuilder() : null; + } else { + testsBuilder_.addAllMessages(other.tests_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListTestsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListTestsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List tests_ = + java.util.Collections.emptyList(); + private void ensureTestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tests_ = new java.util.ArrayList(tests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, com.google.showcase.v1beta1.Test.Builder, com.google.showcase.v1beta1.TestOrBuilder> testsBuilder_; + + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsList() { + if (testsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tests_); + } else { + return testsBuilder_.getMessageList(); + } + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public int getTestsCount() { + if (testsBuilder_ == null) { + return tests_.size(); + } else { + return testsBuilder_.getCount(); + } + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test getTests(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessage(index); + } + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests( + int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.set(index, value); + onChanged(); + } else { + testsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests( + int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.set(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(value); + onChanged(); + } else { + testsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests( + int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(index, value); + onChanged(); + } else { + testsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests( + com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests( + int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addAllTests( + java.lang.Iterable values) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tests_); + onChanged(); + } else { + testsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder clearTests() { + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testsBuilder_.clear(); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder removeTests(int index) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.remove(index); + onChanged(); + } else { + testsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder getTestsBuilder( + int index) { + return getTestsFieldBuilder().getBuilder(index); + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder( + int index) { + if (testsBuilder_ == null) { + return tests_.get(index); } else { + return testsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List + getTestsOrBuilderList() { + if (testsBuilder_ != null) { + return testsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tests_); + } + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder() { + return getTestsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder( + int index) { + return getTestsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + /** + *
+     * The tests being returned.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List + getTestsBuilderList() { + return getTestsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, com.google.showcase.v1beta1.Test.Builder, com.google.showcase.v1beta1.TestOrBuilder> + getTestsFieldBuilder() { + if (testsBuilder_ == null) { + testsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, com.google.showcase.v1beta1.Test.Builder, com.google.showcase.v1beta1.TestOrBuilder>( + tests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + tests_ = null; + } + return testsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * 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; + } + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * 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; + } + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * 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; + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token, if any.
+     * An empty value here means the last page has been reached.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsResponse) + private static final com.google.showcase.v1beta1.ListTestsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsResponse(); + } + + public static com.google.showcase.v1beta1.ListTestsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTestsResponse(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.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java new file mode 100644 index 0000000000..81665ac3c3 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListTestsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List + getTestsList(); + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.Test getTests(int index); + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + int getTestsCount(); + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List + getTestsOrBuilderList(); + /** + *
+   * The tests being returned.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder( + int index); + + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token, if any.
+   * An empty value here means the last page has been reached.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java new file mode 100644 index 0000000000..7f5da71c80 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java @@ -0,0 +1,695 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Identity\ListUsers
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ +public final class ListUsersRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersRequest) + ListUsersRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListUsersRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListUsersRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListUsersRequest( + 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 8: { + + pageSize_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + /** + *
+   * The maximum number of users to return. Server may return fewer users
+   * than requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Identity\ListUsers` method.
+   * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Identity\ListUsers` method.
+   * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListUsersRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersRequest other = (com.google.showcase.v1beta1.ListUsersRequest) obj; + + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Identity\ListUsers
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersRequest) + com.google.showcase.v1beta1.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersRequest.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(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest build() { + com.google.showcase.v1beta1.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest buildPartial() { + com.google.showcase.v1beta1.ListUsersRequest result = new com.google.showcase.v1beta1.ListUsersRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListUsersRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersRequest other) { + if (other == com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance()) return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListUsersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListUsersRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of users to return. Server may return fewer users
+     * than requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of users to return. Server may return fewer users
+     * than requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 1; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of users to return. Server may return fewer users
+     * than requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 1; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Identity\ListUsers` method.
+     * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Identity\ListUsers` method.
+     * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Identity\ListUsers` method.
+     * 
+ * + * string page_token = 2; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Identity\ListUsers` method.
+     * 
+ * + * string page_token = 2; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Identity\ListUsers` method.
+     * 
+ * + * string page_token = 2; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersRequest) + private static final com.google.showcase.v1beta1.ListUsersRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersRequest(); + } + + public static com.google.showcase.v1beta1.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListUsersRequest(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.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java new file mode 100644 index 0000000000..6785ca3661 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface ListUsersRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The maximum number of users to return. Server may return fewer users
+   * than requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 1; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Identity\ListUsers` method.
+   * 
+ * + * string page_token = 2; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Identity\ListUsers` method.
+   * 
+ * + * string page_token = 2; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java new file mode 100644 index 0000000000..693eb1c2ca --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java @@ -0,0 +1,1061 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response message for the google.showcase.v1beta1.Identity\ListUsers
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ +public final class ListUsersResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersResponse) + ListUsersResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListUsersResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListUsersResponse( + 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)) { + users_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + users_.add( + input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + private java.util.List users_; + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUsers(int index) { + return users_.get(index); + } + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder( + int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListUsersRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+   * next page of results.
+   * 
+ * + * 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 next page of results.
+   * Pass this value in ListUsersRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+   * next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListUsersResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersResponse other = (com.google.showcase.v1beta1.ListUsersResponse) obj; + + if (!getUsersList() + .equals(other.getUsersList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse 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; + } + /** + *
+   * The response message for the google.showcase.v1beta1.Identity\ListUsers
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersResponse) + com.google.showcase.v1beta1.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getUsersFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + usersBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse build() { + com.google.showcase.v1beta1.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse buildPartial() { + com.google.showcase.v1beta1.ListUsersResponse result = new com.google.showcase.v1beta1.ListUsersResponse(this); + int from_bitField0_ = bitField0_; + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListUsersResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersResponse other) { + if (other == com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance()) return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getUsersFieldBuilder() : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListUsersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListUsersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List users_ = + java.util.Collections.emptyList(); + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> usersBuilder_; + + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers( + int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers( + int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers( + int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers( + com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers( + int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUsersBuilder( + int index) { + return getUsersFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder( + int index) { + if (usersBuilder_ == null) { + return users_.get(index); } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder() { + return getUsersFieldBuilder().addBuilder( + com.google.showcase.v1beta1.User.getDefaultInstance()); + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder( + int index) { + return getUsersFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.User.getDefaultInstance()); + } + /** + *
+     * The list of users.
+     * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List + getUsersBuilderList() { + return getUsersFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> + getUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder>( + users_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in ListUsersRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+     * next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListUsersRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+     * next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListUsersRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+     * next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in ListUsersRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+     * next page of results.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in ListUsersRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+     * next page of results.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersResponse) + private static final com.google.showcase.v1beta1.ListUsersResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersResponse(); + } + + public static com.google.showcase.v1beta1.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListUsersResponse(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.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java new file mode 100644 index 0000000000..9326c4804f --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface ListUsersResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List + getUsersList(); + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.User getUsers(int index); + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + int getUsersCount(); + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List + getUsersOrBuilderList(); + /** + *
+   * The list of users.
+   * 
+ * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListUsersRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+   * next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in ListUsersRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
+   * next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java new file mode 100644 index 0000000000..699e398079 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java @@ -0,0 +1,447 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public final class MessagingOuterClass { + private MessagingOuterClass() {} + 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_showcase_v1beta1_Room_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Blurb_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n.schema/google/showcase/v1beta1/messagi" + + "ng.proto\022\027google.showcase.v1beta1\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032#google/lon" + + "grunning/operations.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\032\036google/rpc/error_details.proto\"\341\001\n\004Ro" + + "om\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + + "\340A\002\022\023\n\013description\030\003 \001(\t\0224\n\013create_time\030" + + "\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224" + + "\n\013update_time\030\005 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003:/\352A,\n\034showcase.googleapis.c" + + "om/Room\022\014rooms/{room}\"@\n\021CreateRoomReque" + + "st\022+\n\004room\030\001 \001(\0132\035.google.showcase.v1bet" + + "a1.Room\"D\n\016GetRoomRequest\0222\n\004name\030\001 \001(\tB" + + "$\372A\036\n\034showcase.googleapis.com/Room\340A\002\"q\n" + + "\021UpdateRoomRequest\022+\n\004room\030\001 \001(\0132\035.googl" + + "e.showcase.v1beta1.Room\022/\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMask\"G\n\021Dele" + + "teRoomRequest\0222\n\004name\030\001 \001(\tB$\372A\036\n\034showca" + + "se.googleapis.com/Room\340A\002\"9\n\020ListRoomsRe" + + "quest\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002" + + " \001(\t\"Z\n\021ListRoomsResponse\022,\n\005rooms\030\001 \003(\013" + + "2\035.google.showcase.v1beta1.Room\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\366\003\n\005Blurb\022\014\n\004name\030\001 \001(\t" + + "\0222\n\004user\030\002 \001(\tB$\372A\036\n\034showcase.googleapis" + + ".com/User\340A\002\022\016\n\004text\030\003 \001(\tH\000\022\017\n\005image\030\004 " + + "\001(\014H\000\0224\n\013create_time\030\005 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022\030\n\016leg" + + "acy_room_id\030\007 \001(\tH\001\022\030\n\016legacy_user_id\030\010 " + + "\001(\tH\001:\321\001\352A\315\001\n\035showcase.googleapis.com/Bl" + + "urb\0228users/{user}/profile/blurbs/legacy/" + + "{legacy_user}~{blurb}\022#users/{user}/prof" + + "ile/blurbs/{blurb}\022\033rooms/{room}/blurbs/" + + "{blurb}\0220rooms/{room}/blurbs/legacy/{leg" + + "acy_room}.{blurb}B\t\n\007contentB\013\n\tlegacy_i" + + "d\"z\n\022CreateBlurbRequest\0225\n\006parent\030\001 \001(\tB" + + "%\372A\037\022\035showcase.googleapis.com/Blurb\340A\002\022-" + + "\n\005blurb\030\002 \001(\0132\036.google.showcase.v1beta1." + + "Blurb\"F\n\017GetBlurbRequest\0223\n\004name\030\001 \001(\tB%" + + "\372A\037\n\035showcase.googleapis.com/Blurb\340A\002\"t\n" + + "\022UpdateBlurbRequest\022-\n\005blurb\030\001 \001(\0132\036.goo" + + "gle.showcase.v1beta1.Blurb\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"I\n\022D" + + "eleteBlurbRequest\0223\n\004name\030\001 \001(\tB%\372A\037\n\035sh" + + "owcase.googleapis.com/Blurb\340A\002\"q\n\021ListBl" + + "urbsRequest\0225\n\006parent\030\001 \001(\tB%\372A\037\022\035showca" + + "se.googleapis.com/Blurb\340A\002\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"]\n\022ListBlurbsR" + + "esponse\022.\n\006blurbs\030\001 \003(\0132\036.google.showcas" + + "e.v1beta1.Blurb\022\027\n\017next_page_token\030\002 \001(\t" + + "\"\204\001\n\023SearchBlurbsRequest\022\022\n\005query\030\001 \001(\tB" + + "\003\340A\002\0222\n\006parent\030\002 \001(\tB\"\372A\037\022\035showcase.goog" + + "leapis.com/Blurb\022\021\n\tpage_size\030\003 \001(\005\022\022\n\np" + + "age_token\030\004 \001(\t\"A\n\024SearchBlurbsMetadata\022" + + ")\n\nretry_info\030\001 \001(\0132\025.google.rpc.RetryIn" + + "fo\"_\n\024SearchBlurbsResponse\022.\n\006blurbs\030\001 \003" + + "(\0132\036.google.showcase.v1beta1.Blurb\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\200\001\n\023StreamBlurbsRequ" + + "est\0223\n\004name\030\001 \001(\tB%\372A\037\022\035showcase.googlea" + + "pis.com/Blurb\340A\002\0224\n\013expire_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\002\"\321\001\n\024Strea" + + "mBlurbsResponse\022-\n\005blurb\030\001 \001(\0132\036.google." + + "showcase.v1beta1.Blurb\022D\n\006action\030\002 \001(\01624" + + ".google.showcase.v1beta1.StreamBlurbsRes" + + "ponse.Action\"D\n\006Action\022\026\n\022ACTION_UNSPECI" + + "FIED\020\000\022\n\n\006CREATE\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE" + + "\020\003\"#\n\022SendBlurbsResponse\022\r\n\005names\030\001 \003(\t\"" + + "\332\001\n\016ConnectRequest\022G\n\006config\030\001 \001(\01325.goo" + + "gle.showcase.v1beta1.ConnectRequest.Conn" + + "ectConfigH\000\022/\n\005blurb\030\002 \001(\0132\036.google.show" + + "case.v1beta1.BlurbH\000\032C\n\rConnectConfig\0222\n" + + "\006parent\030\001 \001(\tB\"\372A\037\022\035showcase.googleapis." + + "com/BlurbB\t\n\007request2\264\023\n\tMessaging\022\227\001\n\nC" + + "reateRoom\022*.google.showcase.v1beta1.Crea" + + "teRoomRequest\032\035.google.showcase.v1beta1." + + "Room\">\202\323\344\223\002\023\"\016/v1beta1/rooms:\001*\332A\"room.d" + + "isplay_name,room.description\022y\n\007GetRoom\022" + + "\'.google.showcase.v1beta1.GetRoomRequest" + + "\032\035.google.showcase.v1beta1.Room\"&\202\323\344\223\002\031\022" + + "\027/v1beta1/{name=rooms/*}\332A\004name\022\203\001\n\nUpda" + + "teRoom\022*.google.showcase.v1beta1.UpdateR" + + "oomRequest\032\035.google.showcase.v1beta1.Roo" + + "m\"*\202\323\344\223\002$2\034/v1beta1/{room.name=rooms/*}:" + + "\004room\022x\n\nDeleteRoom\022*.google.showcase.v1" + + "beta1.DeleteRoomRequest\032\026.google.protobu" + + "f.Empty\"&\202\323\344\223\002\031*\027/v1beta1/{name=rooms/*}" + + "\332A\004name\022z\n\tListRooms\022).google.showcase.v" + + "1beta1.ListRoomsRequest\032*.google.showcas" + + "e.v1beta1.ListRoomsResponse\"\026\202\323\344\223\002\020\022\016/v1" + + "beta1/rooms\022\366\001\n\013CreateBlurb\022+.google.sho" + + "wcase.v1beta1.CreateBlurbRequest\032\036.googl" + + "e.showcase.v1beta1.Blurb\"\231\001\202\323\344\223\002T\" /v1be" + + "ta1/{parent=rooms/*}/blurbs:\001*Z-\"(/v1bet" + + "a1/{parent=users/*/profile}/blurbs:\001*\332A\034" + + "parent,blurb.user,blurb.text\332A\035parent,bl" + + "urb.user,blurb.image\022\261\001\n\010GetBlurb\022(.goog" + + "le.showcase.v1beta1.GetBlurbRequest\032\036.go" + + "ogle.showcase.v1beta1.Blurb\"[\202\323\344\223\002N\022 /v1" + + "beta1/{name=rooms/*/blurbs/*}Z*\022(/v1beta" + + "1/{name=users/*/profile/blurbs/*}\332A\004name" + + "\022\312\001\n\013UpdateBlurb\022+.google.showcase.v1bet" + + "a1.UpdateBlurbRequest\032\036.google.showcase." + + "v1beta1.Blurb\"n\202\323\344\223\002h2&/v1beta1/{blurb.n" + + "ame=rooms/*/blurbs/*}:\005blurbZ72./v1beta1" + + "/{blurb.name=users/*/profile/blurbs/*}:\005" + + "blurb\022\257\001\n\013DeleteBlurb\022+.google.showcase." + + "v1beta1.DeleteBlurbRequest\032\026.google.prot" + + "obuf.Empty\"[\202\323\344\223\002N* /v1beta1/{name=rooms" + + "/*/blurbs/*}Z**(/v1beta1/{name=users/*/p" + + "rofile/blurbs/*}\332A\004name\022\304\001\n\nListBlurbs\022*" + + ".google.showcase.v1beta1.ListBlurbsReque" + + "st\032+.google.showcase.v1beta1.ListBlurbsR" + + "esponse\"]\202\323\344\223\002N\022 /v1beta1/{parent=rooms/" + + "*}/blurbsZ*\022(/v1beta1/{parent=users/*/pr" + + "ofile}/blurbs\332A\006parent\022\201\002\n\014SearchBlurbs\022" + + ",.google.showcase.v1beta1.SearchBlurbsRe" + + "quest\032\035.google.longrunning.Operation\"\243\001\202" + + "\323\344\223\002_\"\'/v1beta1/{parent=rooms/*}/blurbs:" + + "search:\001*Z1\"//v1beta1/{parent=users/*/pr" + + "ofile}/blurbs:search\312A,\n\024SearchBlurbsRes" + + "ponse\022\024SearchBlurbsMetadata\332A\014parent,que" + + "ry\022\323\001\n\014StreamBlurbs\022,.google.showcase.v1" + + "beta1.StreamBlurbsRequest\032-.google.showc" + + "ase.v1beta1.StreamBlurbsResponse\"d\202\323\344\223\002^" + + "\"%/v1beta1/{name=rooms/*}/blurbs:stream:" + + "\001*Z2\"-/v1beta1/{name=users/*/profile}/bl" + + "urbs:stream:\001*0\001\022\316\001\n\nSendBlurbs\022+.google" + + ".showcase.v1beta1.CreateBlurbRequest\032+.g" + + "oogle.showcase.v1beta1.SendBlurbsRespons" + + "e\"d\202\323\344\223\002^\"%/v1beta1/{parent=rooms/*}/blu" + + "rbs:send:\001*Z2\"-/v1beta1/{parent=users/*/" + + "profile}/blurbs:send:\001*(\001\022e\n\007Connect\022\'.g" + + "oogle.showcase.v1beta1.ConnectRequest\032-." + + "google.showcase.v1beta1.StreamBlurbsResp" + + "onse(\0010\001\032\021\312A\016localhost:7469Bq\n\033com.googl" + + "e.showcase.v1beta1P\001Z4github.com/googlea" + + "pis/gapic-showcase/server/genproto\352\002\031Goo" + + "gle::Showcase::V1beta1b\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.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.ErrorDetailsProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Room_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Room_descriptor, + new java.lang.String[] { "Name", "DisplayName", "Description", "CreateTime", "UpdateTime", }); + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor, + new java.lang.String[] { "Room", }); + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor, + new java.lang.String[] { "Room", "UpdateMask", }); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor, + new java.lang.String[] { "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor, + new java.lang.String[] { "Rooms", "NextPageToken", }); + internal_static_google_showcase_v1beta1_Blurb_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Blurb_descriptor, + new java.lang.String[] { "Name", "User", "Text", "Image", "CreateTime", "UpdateTime", "LegacyRoomId", "LegacyUserId", "Content", "LegacyId", }); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor, + new java.lang.String[] { "Parent", "Blurb", }); + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor, + new java.lang.String[] { "Blurb", "UpdateMask", }); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor, + new java.lang.String[] { "Blurbs", "NextPageToken", }); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor, + new java.lang.String[] { "Query", "Parent", "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor, + new java.lang.String[] { "RetryInfo", }); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor, + new java.lang.String[] { "Blurbs", "NextPageToken", }); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor, + new java.lang.String[] { "Name", "ExpireTime", }); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor, + new java.lang.String[] { "Blurb", "Action", }); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor, + new java.lang.String[] { "Names", }); + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor, + new java.lang.String[] { "Config", "Blurb", "Request", }); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor = + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor, + new java.lang.String[] { "Parent", }); + 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.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.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.ErrorDetailsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java new file mode 100644 index 0000000000..ddef8cc042 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java @@ -0,0 +1,942 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} + */ +public final class PagedExpandLegacyMappedResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + PagedExpandLegacyMappedResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use PagedExpandLegacyMappedResponse.newBuilder() to construct. + private PagedExpandLegacyMappedResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PagedExpandLegacyMappedResponse() { + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PagedExpandLegacyMappedResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PagedExpandLegacyMappedResponse( + 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)) { + alphabetized_ = com.google.protobuf.MapField.newMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + alphabetized__ = input.readMessage( + AlphabetizedDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + alphabetized_.getMutableMap().put( + alphabetized__.getKey(), alphabetized__.getValue()); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + public static final int ALPHABETIZED_FIELD_NUMBER = 1; + private static final class AlphabetizedDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> alphabetized_; + private com.google.protobuf.MapField + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().getMap().size(); + } + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + + @java.lang.Override + public boolean containsAlphabetized( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAlphabetized().getMap().containsKey(key); + } + /** + * Use {@link #getAlphabetizedMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAlphabetized() { + return getAlphabetizedMap(); + } + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + @java.lang.Override + + public java.util.Map getAlphabetizedMap() { + return internalGetAlphabetized().getMap(); + } + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + @java.lang.Override + + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAlphabetized().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + @java.lang.Override + + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAlphabetized().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAlphabetized(), + AlphabetizedDefaultEntryHolder.defaultEntry, + 1); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetAlphabetized().getMap().entrySet()) { + com.google.protobuf.MapEntry + alphabetized__ = AlphabetizedDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alphabetized__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other = (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) obj; + + if (!internalGetAlphabetized().equals( + other.internalGetAlphabetized())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetAlphabetized().getMap().isEmpty()) { + hash = (37 * hash) + ALPHABETIZED_FIELD_NUMBER; + hash = (53 * hash) + internalGetAlphabetized().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableAlphabetized(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.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(); + internalGetMutableAlphabetized().clear(); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse build() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(this); + int from_bitField0_ = bitField0_; + result.alphabetized_ = internalGetAlphabetized(); + result.alphabetized_.makeImmutable(); + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance()) return this; + internalGetMutableAlphabetized().mergeFrom( + other.internalGetAlphabetized()); + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> alphabetized_; + private com.google.protobuf.MapField + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + private com.google.protobuf.MapField + internalGetMutableAlphabetized() { + onChanged();; + if (alphabetized_ == null) { + alphabetized_ = com.google.protobuf.MapField.newMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + if (!alphabetized_.isMutable()) { + alphabetized_ = alphabetized_.copy(); + } + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().getMap().size(); + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + + @java.lang.Override + public boolean containsAlphabetized( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAlphabetized().getMap().containsKey(key); + } + /** + * Use {@link #getAlphabetizedMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAlphabetized() { + return getAlphabetizedMap(); + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + @java.lang.Override + + public java.util.Map getAlphabetizedMap() { + return internalGetAlphabetized().getMap(); + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + @java.lang.Override + + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAlphabetized().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + @java.lang.Override + + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAlphabetized().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAlphabetized() { + internalGetMutableAlphabetized().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + + public Builder removeAlphabetized( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAlphabetized().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAlphabetized() { + return internalGetMutableAlphabetized().getMutableMap(); + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + public Builder putAlphabetized( + java.lang.String key, + com.google.showcase.v1beta1.PagedExpandResponseList value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); +} + + internalGetMutableAlphabetized().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * The words that were expanded, indexed by their initial character.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+     * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + + public Builder putAllAlphabetized( + java.util.Map values) { + internalGetMutableAlphabetized().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + private static final com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyMappedResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandLegacyMappedResponse(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.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java new file mode 100644 index 0000000000..2d81d0ce10 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandLegacyMappedResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + int getAlphabetizedCount(); + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + boolean containsAlphabetized( + java.lang.String key); + /** + * Use {@link #getAlphabetizedMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAlphabetized(); + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + java.util.Map + getAlphabetizedMap(); + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + + /* nullable */ +com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ +com.google.showcase.v1beta1.PagedExpandResponseList defaultValue); + /** + *
+   * The words that were expanded, indexed by their initial character.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
+   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
+   * 
+ * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + */ + + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key); + + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java new file mode 100644 index 0000000000..5a0fecec07 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java @@ -0,0 +1,853 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
+ * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
+ * aip.dev/158.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ +public final class PagedExpandLegacyRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + PagedExpandLegacyRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use PagedExpandLegacyRequest.newBuilder() to construct. + private PagedExpandLegacyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PagedExpandLegacyRequest() { + content_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PagedExpandLegacyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PagedExpandLegacyRequest( + 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(); + + content_ = s; + break; + } + case 16: { + + maxResults_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_; + /** + *
+   * The number of words to returned in each page.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
+   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
+   * 
+ * + * int32 max_results = 2; + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyRequest other = (com.google.showcase.v1beta1.PagedExpandLegacyRequest) obj; + + if (!getContent() + .equals(other.getContent())) return false; + if (getMaxResults() + != other.getMaxResults()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest 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; + } + /** + *
+   * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
+   * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
+   * aip.dev/158.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.showcase.v1beta1.PagedExpandLegacyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyRequest.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(); + content_ = ""; + + maxResults_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest build() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(this); + result.content_ = content_; + result.maxResults_ = maxResults_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandLegacyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandLegacyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int maxResults_ ; + /** + *
+     * The number of words to returned in each page.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
+     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
+     * 
+ * + * int32 max_results = 2; + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + /** + *
+     * The number of words to returned in each page.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
+     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
+     * 
+ * + * int32 max_results = 2; + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + onChanged(); + return this; + } + /** + *
+     * The number of words to returned in each page.
+     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
+     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
+     * 
+ * + * int32 max_results = 2; + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + private static final com.google.showcase.v1beta1.PagedExpandLegacyRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandLegacyRequest(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.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java new file mode 100644 index 0000000000..54a86448e2 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandLegacyRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + *
+   * The number of words to returned in each page.
+   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
+   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
+   * 
+ * + * int32 max_results = 2; + * @return The maxResults. + */ + int getMaxResults(); + + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java new file mode 100644 index 0000000000..291ce47b8b --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java @@ -0,0 +1,841 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for the PagedExpand method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ +public final class PagedExpandRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandRequest) + PagedExpandRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use PagedExpandRequest.newBuilder() to construct. + private PagedExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PagedExpandRequest() { + content_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PagedExpandRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PagedExpandRequest( + 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(); + + content_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The number of words to returned in each page.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandRequest other = (com.google.showcase.v1beta1.PagedExpandRequest) obj; + + if (!getContent() + .equals(other.getContent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest 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; + } + /** + *
+   * The request for the PagedExpand method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandRequest) + com.google.showcase.v1beta1.PagedExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandRequest.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(); + content_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest build() { + com.google.showcase.v1beta1.PagedExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandRequest result = new com.google.showcase.v1beta1.PagedExpandRequest(this); + result.content_ = content_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+     * The string to expand.
+     * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The number of words to returned in each page.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The number of words to returned in each page.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The number of words to returned in each page.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The position of the page to be returned.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandRequest) + private static final com.google.showcase.v1beta1.PagedExpandRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandRequest(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.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java new file mode 100644 index 0000000000..dc5b9a11b1 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * The string to expand.
+   * 
+ * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + *
+   * The number of words to returned in each page.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The position of the page to be returned.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java new file mode 100644 index 0000000000..a0c8934c64 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java @@ -0,0 +1,1038 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response for the PagedExpand method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ +public final class PagedExpandResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponse) + PagedExpandResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use PagedExpandResponse.newBuilder() to construct. + private PagedExpandResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PagedExpandResponse() { + responses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PagedExpandResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PagedExpandResponse( + 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)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage(com.google.showcase.v1beta1.EchoResponse.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + return responses_.get(index); + } + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, responses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponse other = (com.google.showcase.v1beta1.PagedExpandResponse) obj; + + if (!getResponsesList() + .equals(other.getResponsesList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse 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; + } + /** + *
+   * The response for the PagedExpand method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponse) + com.google.showcase.v1beta1.PagedExpandResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse build() { + com.google.showcase.v1beta1.PagedExpandResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponse result = new com.google.showcase.v1beta1.PagedExpandResponse(this); + int from_bitField0_ = bitField0_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance()) return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResponsesFieldBuilder() : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List responses_ = + java.util.Collections.emptyList(); + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, com.google.showcase.v1beta1.EchoResponse.Builder, com.google.showcase.v1beta1.EchoResponseOrBuilder> responsesBuilder_; + + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses( + com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder().addBuilder( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + /** + *
+     * The words that were expanded.
+     * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, com.google.showcase.v1beta1.EchoResponse.Builder, com.google.showcase.v1beta1.EchoResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, com.google.showcase.v1beta1.EchoResponse.Builder, com.google.showcase.v1beta1.EchoResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponse) + private static final com.google.showcase.v1beta1.PagedExpandResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandResponse(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.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java new file mode 100644 index 0000000000..61a75fdeb1 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java @@ -0,0 +1,624 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * A list of words.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ +public final class PagedExpandResponseList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponseList) + PagedExpandResponseListOrBuilder { +private static final long serialVersionUID = 0L; + // Use PagedExpandResponseList.newBuilder() to construct. + private PagedExpandResponseList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PagedExpandResponseList() { + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PagedExpandResponseList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PagedExpandResponseList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + words_.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)) { + words_ = words_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + public static final int WORDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList words_; + /** + * repeated string words = 1; + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList + getWordsList() { + return words_; + } + /** + * repeated string words = 1; + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + /** + * repeated string words = 1; + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + /** + * repeated string words = 1; + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString + getWordsBytes(int index) { + return words_.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 < words_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, words_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < words_.size(); i++) { + dataSize += computeStringSizeNoTag(words_.getRaw(i)); + } + size += dataSize; + size += 1 * getWordsList().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.showcase.v1beta1.PagedExpandResponseList)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponseList other = (com.google.showcase.v1beta1.PagedExpandResponseList) obj; + + if (!getWordsList() + .equals(other.getWordsList())) 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 (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList 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 list of words.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponseList) + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponseList.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(); + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList build() { + com.google.showcase.v1beta1.PagedExpandResponseList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponseList result = new com.google.showcase.v1beta1.PagedExpandResponseList(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + words_ = words_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.words_ = words_; + 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.showcase.v1beta1.PagedExpandResponseList) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponseList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponseList other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()) return this; + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + 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.showcase.v1beta1.PagedExpandResponseList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandResponseList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureWordsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + words_ = new com.google.protobuf.LazyStringArrayList(words_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated string words = 1; + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList + getWordsList() { + return words_.getUnmodifiableView(); + } + /** + * repeated string words = 1; + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + /** + * repeated string words = 1; + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + /** + * repeated string words = 1; + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString + getWordsBytes(int index) { + return words_.getByteString(index); + } + /** + * repeated string words = 1; + * @param index The index to set the value at. + * @param value The words to set. + * @return This builder for chaining. + */ + public Builder setWords( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + onChanged(); + return this; + } + /** + * repeated string words = 1; + * @param value The words to add. + * @return This builder for chaining. + */ + public Builder addWords( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + return this; + } + /** + * repeated string words = 1; + * @param values The words to add. + * @return This builder for chaining. + */ + public Builder addAllWords( + java.lang.Iterable values) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, words_); + onChanged(); + return this; + } + /** + * repeated string words = 1; + * @return This builder for chaining. + */ + public Builder clearWords() { + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated string words = 1; + * @param value The bytes of the words to add. + * @return This builder for chaining. + */ + public Builder addWordsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWordsIsMutable(); + words_.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.showcase.v1beta1.PagedExpandResponseList) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponseList) + private static final com.google.showcase.v1beta1.PagedExpandResponseList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponseList(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponseList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandResponseList(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.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java new file mode 100644 index 0000000000..56c27b2f60 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandResponseListOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponseList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string words = 1; + * @return A list containing the words. + */ + java.util.List + getWordsList(); + /** + * repeated string words = 1; + * @return The count of words. + */ + int getWordsCount(); + /** + * repeated string words = 1; + * @param index The index of the element to return. + * @return The words at the given index. + */ + java.lang.String getWords(int index); + /** + * repeated string words = 1; + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + com.google.protobuf.ByteString + getWordsBytes(int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java new file mode 100644 index 0000000000..613e7031bd --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List + getResponsesList(); + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponse getResponses(int index); + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + int getResponsesCount(); + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + *
+   * The words that were expanded.
+   * 
+ * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder( + int index); + + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java new file mode 100644 index 0000000000..b69500d0ae --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 ProfileName implements ResourceName { + private static final PathTemplate USER = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected ProfileName() { + user = null; + } + + private ProfileName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProfileName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static ProfileName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch( + formattedString, "ProfileName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (ProfileName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProfileName that = ((ProfileName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}/profile/blurbs. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(ProfileName profileName) { + this.user = profileName.user; + } + + public ProfileName build() { + return new ProfileName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java new file mode 100644 index 0000000000..3a22cdf230 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java @@ -0,0 +1,1518 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.RepeatRequest} + */ +public final class RepeatRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatRequest) + RepeatRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use RepeatRequest.newBuilder() to construct. + private RepeatRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RepeatRequest() { + name_ = ""; + intendedBindingUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RepeatRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RepeatRequest( + 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.showcase.v1beta1.ComplianceData.Builder subBuilder = null; + if (info_ != null) { + subBuilder = info_.toBuilder(); + } + info_ = input.readMessage(com.google.showcase.v1beta1.ComplianceData.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(info_); + info_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + + serverVerify_ = input.readBool(); + break; + } + case 32: { + + fInt32_ = input.readInt32(); + break; + } + case 40: { + + fInt64_ = input.readInt64(); + break; + } + case 49: { + + fDouble_ = input.readDouble(); + break; + } + case 56: { + bitField0_ |= 0x00000002; + pInt32_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000004; + pInt64_ = input.readInt64(); + break; + } + case 73: { + bitField0_ |= 0x00000008; + pDouble_ = input.readDouble(); + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + intendedBindingUri_ = 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.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * string name = 1; + * @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; + } + } + /** + * string name = 1; + * @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 INFO_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.ComplianceData info_; + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * @return Whether the info field is set. + */ + @java.lang.Override + public boolean hasInfo() { + return info_ != null; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * @return The info. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getInfo() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + return getInfo(); + } + + public static final int SERVER_VERIFY_FIELD_NUMBER = 3; + private boolean serverVerify_; + /** + *
+   * If true, the server will verify that the received request matches
+   * the request with the same name in the compliance test suite.
+   * 
+ * + * bool server_verify = 3; + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + public static final int INTENDED_BINDING_URI_FIELD_NUMBER = 10; + private volatile java.lang.Object intendedBindingUri_; + /** + *
+   * The URI template this request is expected to be bound to server-side.
+   * 
+ * + * optional string intended_binding_uri = 10; + * @return Whether the intendedBindingUri field is set. + */ + @java.lang.Override + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The URI template this request is expected to be bound to server-side.
+   * 
+ * + * optional string intended_binding_uri = 10; + * @return The intendedBindingUri. + */ + @java.lang.Override + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + 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(); + intendedBindingUri_ = s; + return s; + } + } + /** + *
+   * The URI template this request is expected to be bound to server-side.
+   * 
+ * + * optional string intended_binding_uri = 10; + * @return The bytes for intendedBindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 4; + private int fInt32_; + /** + *
+   * Some top level fields, to test that these are encoded correctly
+   * in query params.
+   * 
+ * + * int32 f_int32 = 4; + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_INT64_FIELD_NUMBER = 5; + private long fInt64_; + /** + * int64 f_int64 = 5; + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 6; + private double fDouble_; + /** + * double f_double = 6; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int P_INT32_FIELD_NUMBER = 7; + private int pInt32_; + /** + * optional int32 p_int32 = 7; + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional int32 p_int32 = 7; + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_INT64_FIELD_NUMBER = 8; + private long pInt64_; + /** + * optional int64 p_int64 = 8; + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional int64 p_int64 = 8; + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 9; + private double pDouble_; + /** + * optional double p_double = 9; + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional double p_double = 9; + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + 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 (info_ != null) { + output.writeMessage(2, getInfo()); + } + if (serverVerify_ != false) { + output.writeBool(3, serverVerify_); + } + if (fInt32_ != 0) { + output.writeInt32(4, fInt32_); + } + if (fInt64_ != 0L) { + output.writeInt64(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(6, fDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(7, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(8, pInt64_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(9, pDouble_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, intendedBindingUri_); + } + 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 (info_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getInfo()); + } + if (serverVerify_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, serverVerify_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, fInt32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(6, fDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, pInt64_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(9, pDouble_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, intendedBindingUri_); + } + 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.showcase.v1beta1.RepeatRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatRequest other = (com.google.showcase.v1beta1.RepeatRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasInfo() != other.hasInfo()) return false; + if (hasInfo()) { + if (!getInfo() + .equals(other.getInfo())) return false; + } + if (getServerVerify() + != other.getServerVerify()) return false; + if (hasIntendedBindingUri() != other.hasIntendedBindingUri()) return false; + if (hasIntendedBindingUri()) { + if (!getIntendedBindingUri() + .equals(other.getIntendedBindingUri())) return false; + } + if (getFInt32() + != other.getFInt32()) return false; + if (getFInt64() + != other.getFInt64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits( + other.getFDouble())) return false; + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() + != other.getPInt32()) return false; + } + if (hasPInt64() != other.hasPInt64()) return false; + if (hasPInt64()) { + if (getPInt64() + != other.getPInt64()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits( + other.getPDouble())) 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 (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (37 * hash) + SERVER_VERIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getServerVerify()); + if (hasIntendedBindingUri()) { + hash = (37 * hash) + INTENDED_BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getIntendedBindingUri().hashCode(); + } + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFInt64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPInt64()) { + hash = (37 * hash) + P_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPInt64()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.RepeatRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatRequest) + com.google.showcase.v1beta1.RepeatRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatRequest.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_ = ""; + + if (infoBuilder_ == null) { + info_ = null; + } else { + info_ = null; + infoBuilder_ = null; + } + serverVerify_ = false; + + intendedBindingUri_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + fInt32_ = 0; + + fInt64_ = 0L; + + fDouble_ = 0D; + + pInt32_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + pInt64_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + pDouble_ = 0D; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest build() { + com.google.showcase.v1beta1.RepeatRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest buildPartial() { + com.google.showcase.v1beta1.RepeatRequest result = new com.google.showcase.v1beta1.RepeatRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (infoBuilder_ == null) { + result.info_ = info_; + } else { + result.info_ = infoBuilder_.build(); + } + result.serverVerify_ = serverVerify_; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.intendedBindingUri_ = intendedBindingUri_; + result.fInt32_ = fInt32_; + result.fInt64_ = fInt64_; + result.fDouble_ = fDouble_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pInt64_ = pInt64_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.RepeatRequest) { + return mergeFrom((com.google.showcase.v1beta1.RepeatRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatRequest other) { + if (other == com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasInfo()) { + mergeInfo(other.getInfo()); + } + if (other.getServerVerify() != false) { + setServerVerify(other.getServerVerify()); + } + if (other.hasIntendedBindingUri()) { + bitField0_ |= 0x00000001; + intendedBindingUri_ = other.intendedBindingUri_; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPInt64()) { + setPInt64(other.getPInt64()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + 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.showcase.v1beta1.RepeatRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RepeatRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @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; + } + } + /** + * string name = 1; + * @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; + } + } + /** + * string name = 1; + * @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; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 1; + * @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.showcase.v1beta1.ComplianceData info_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, com.google.showcase.v1beta1.ComplianceData.Builder, com.google.showcase.v1beta1.ComplianceDataOrBuilder> infoBuilder_; + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * @return Whether the info field is set. + */ + public boolean hasInfo() { + return infoBuilder_ != null || info_ != null; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * @return The info. + */ + public com.google.showcase.v1beta1.ComplianceData getInfo() { + if (infoBuilder_ == null) { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } else { + return infoBuilder_.getMessage(); + } + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + onChanged(); + } else { + infoBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + public Builder setInfo( + com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { + if (infoBuilder_ == null) { + info_ = builderForValue.build(); + onChanged(); + } else { + infoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + public Builder mergeInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (info_ != null) { + info_ = + com.google.showcase.v1beta1.ComplianceData.newBuilder(info_).mergeFrom(value).buildPartial(); + } else { + info_ = value; + } + onChanged(); + } else { + infoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + public Builder clearInfo() { + if (infoBuilder_ == null) { + info_ = null; + onChanged(); + } else { + info_ = null; + infoBuilder_ = null; + } + + return this; + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + public com.google.showcase.v1beta1.ComplianceData.Builder getInfoBuilder() { + + onChanged(); + return getInfoFieldBuilder().getBuilder(); + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilder(); + } else { + return info_ == null ? + com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + } + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, com.google.showcase.v1beta1.ComplianceData.Builder, com.google.showcase.v1beta1.ComplianceDataOrBuilder> + getInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, com.google.showcase.v1beta1.ComplianceData.Builder, com.google.showcase.v1beta1.ComplianceDataOrBuilder>( + getInfo(), + getParentForChildren(), + isClean()); + info_ = null; + } + return infoBuilder_; + } + + private boolean serverVerify_ ; + /** + *
+     * If true, the server will verify that the received request matches
+     * the request with the same name in the compliance test suite.
+     * 
+ * + * bool server_verify = 3; + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + /** + *
+     * If true, the server will verify that the received request matches
+     * the request with the same name in the compliance test suite.
+     * 
+ * + * bool server_verify = 3; + * @param value The serverVerify to set. + * @return This builder for chaining. + */ + public Builder setServerVerify(boolean value) { + + serverVerify_ = value; + onChanged(); + return this; + } + /** + *
+     * If true, the server will verify that the received request matches
+     * the request with the same name in the compliance test suite.
+     * 
+ * + * bool server_verify = 3; + * @return This builder for chaining. + */ + public Builder clearServerVerify() { + + serverVerify_ = false; + onChanged(); + return this; + } + + private java.lang.Object intendedBindingUri_ = ""; + /** + *
+     * The URI template this request is expected to be bound to server-side.
+     * 
+ * + * optional string intended_binding_uri = 10; + * @return Whether the intendedBindingUri field is set. + */ + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * The URI template this request is expected to be bound to server-side.
+     * 
+ * + * optional string intended_binding_uri = 10; + * @return The intendedBindingUri. + */ + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intendedBindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URI template this request is expected to be bound to server-side.
+     * 
+ * + * optional string intended_binding_uri = 10; + * @return The bytes for intendedBindingUri. + */ + public com.google.protobuf.ByteString + getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URI template this request is expected to be bound to server-side.
+     * 
+ * + * optional string intended_binding_uri = 10; + * @param value The intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + intendedBindingUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The URI template this request is expected to be bound to server-side.
+     * 
+ * + * optional string intended_binding_uri = 10; + * @return This builder for chaining. + */ + public Builder clearIntendedBindingUri() { + bitField0_ = (bitField0_ & ~0x00000001); + intendedBindingUri_ = getDefaultInstance().getIntendedBindingUri(); + onChanged(); + return this; + } + /** + *
+     * The URI template this request is expected to be bound to server-side.
+     * 
+ * + * optional string intended_binding_uri = 10; + * @param value The bytes for intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + intendedBindingUri_ = value; + onChanged(); + return this; + } + + private int fInt32_ ; + /** + *
+     * Some top level fields, to test that these are encoded correctly
+     * in query params.
+     * 
+ * + * int32 f_int32 = 4; + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + /** + *
+     * Some top level fields, to test that these are encoded correctly
+     * in query params.
+     * 
+ * + * int32 f_int32 = 4; + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + onChanged(); + return this; + } + /** + *
+     * Some top level fields, to test that these are encoded correctly
+     * in query params.
+     * 
+ * + * int32 f_int32 = 4; + * @return This builder for chaining. + */ + public Builder clearFInt32() { + + fInt32_ = 0; + onChanged(); + return this; + } + + private long fInt64_ ; + /** + * int64 f_int64 = 5; + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + /** + * int64 f_int64 = 5; + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + onChanged(); + return this; + } + /** + * int64 f_int64 = 5; + * @return This builder for chaining. + */ + public Builder clearFInt64() { + + fInt64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_ ; + /** + * double f_double = 6; + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + /** + * double f_double = 6; + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + /** + * double f_double = 6; + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private int pInt32_ ; + /** + * optional int32 p_int32 = 7; + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional int32 p_int32 = 7; + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + /** + * optional int32 p_int32 = 7; + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + bitField0_ |= 0x00000002; + pInt32_ = value; + onChanged(); + return this; + } + /** + * optional int32 p_int32 = 7; + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00000002); + pInt32_ = 0; + onChanged(); + return this; + } + + private long pInt64_ ; + /** + * optional int64 p_int64 = 8; + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional int64 p_int64 = 8; + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + /** + * optional int64 p_int64 = 8; + * @param value The pInt64 to set. + * @return This builder for chaining. + */ + public Builder setPInt64(long value) { + bitField0_ |= 0x00000004; + pInt64_ = value; + onChanged(); + return this; + } + /** + * optional int64 p_int64 = 8; + * @return This builder for chaining. + */ + public Builder clearPInt64() { + bitField0_ = (bitField0_ & ~0x00000004); + pInt64_ = 0L; + onChanged(); + return this; + } + + private double pDouble_ ; + /** + * optional double p_double = 9; + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional double p_double = 9; + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + /** + * optional double p_double = 9; + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + bitField0_ |= 0x00000008; + pDouble_ = value; + onChanged(); + return this; + } + /** + * optional double p_double = 9; + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000008); + pDouble_ = 0D; + 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.showcase.v1beta1.RepeatRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatRequest) + private static final com.google.showcase.v1beta1.RepeatRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatRequest(); + } + + public static com.google.showcase.v1beta1.RepeatRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepeatRequest(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.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java new file mode 100644 index 0000000000..a95f03f773 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java @@ -0,0 +1,132 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface RepeatRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * @return Whether the info field is set. + */ + boolean hasInfo(); + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * @return The info. + */ + com.google.showcase.v1beta1.ComplianceData getInfo(); + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + */ + com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder(); + + /** + *
+   * If true, the server will verify that the received request matches
+   * the request with the same name in the compliance test suite.
+   * 
+ * + * bool server_verify = 3; + * @return The serverVerify. + */ + boolean getServerVerify(); + + /** + *
+   * The URI template this request is expected to be bound to server-side.
+   * 
+ * + * optional string intended_binding_uri = 10; + * @return Whether the intendedBindingUri field is set. + */ + boolean hasIntendedBindingUri(); + /** + *
+   * The URI template this request is expected to be bound to server-side.
+   * 
+ * + * optional string intended_binding_uri = 10; + * @return The intendedBindingUri. + */ + java.lang.String getIntendedBindingUri(); + /** + *
+   * The URI template this request is expected to be bound to server-side.
+   * 
+ * + * optional string intended_binding_uri = 10; + * @return The bytes for intendedBindingUri. + */ + com.google.protobuf.ByteString + getIntendedBindingUriBytes(); + + /** + *
+   * Some top level fields, to test that these are encoded correctly
+   * in query params.
+   * 
+ * + * int32 f_int32 = 4; + * @return The fInt32. + */ + int getFInt32(); + + /** + * int64 f_int64 = 5; + * @return The fInt64. + */ + long getFInt64(); + + /** + * double f_double = 6; + * @return The fDouble. + */ + double getFDouble(); + + /** + * optional int32 p_int32 = 7; + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + /** + * optional int32 p_int32 = 7; + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional int64 p_int64 = 8; + * @return Whether the pInt64 field is set. + */ + boolean hasPInt64(); + /** + * optional int64 p_int64 = 8; + * @return The pInt64. + */ + long getPInt64(); + + /** + * optional double p_double = 9; + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + /** + * optional double p_double = 9; + * @return The pDouble. + */ + double getPDouble(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java new file mode 100644 index 0000000000..48b1ad96ac --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java @@ -0,0 +1,775 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.RepeatResponse} + */ +public final class RepeatResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatResponse) + RepeatResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use RepeatResponse.newBuilder() to construct. + private RepeatResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RepeatResponse() { + bindingUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RepeatResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RepeatResponse( + 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.showcase.v1beta1.RepeatRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + bindingUri_ = 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.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RepeatRequest request_; + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + return request_ == null ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() : request_; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int BINDING_URI_FIELD_NUMBER = 2; + private volatile java.lang.Object bindingUri_; + /** + *
+   * The URI template the request was bound to server-side.
+   * 
+ * + * string binding_uri = 2; + * @return The bindingUri. + */ + @java.lang.Override + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + 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(); + bindingUri_ = s; + return s; + } + } + /** + *
+   * The URI template the request was bound to server-side.
+   * 
+ * + * string binding_uri = 2; + * @return The bytes for bindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bindingUri_ = 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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bindingUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRequest()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bindingUri_); + } + 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.showcase.v1beta1.RepeatResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatResponse other = (com.google.showcase.v1beta1.RepeatResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (!getBindingUri() + .equals(other.getBindingUri())) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getBindingUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.RepeatResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatResponse) + com.google.showcase.v1beta1.RepeatResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatResponse.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 (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + bindingUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse build() { + com.google.showcase.v1beta1.RepeatResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse buildPartial() { + com.google.showcase.v1beta1.RepeatResponse result = new com.google.showcase.v1beta1.RepeatResponse(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + result.bindingUri_ = bindingUri_; + 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.showcase.v1beta1.RepeatResponse) { + return mergeFrom((com.google.showcase.v1beta1.RepeatResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatResponse other) { + if (other == com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (!other.getBindingUri().isEmpty()) { + bindingUri_ = other.bindingUri_; + 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.showcase.v1beta1.RepeatResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RepeatResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.RepeatRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> requestBuilder_; + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * @return The request. + */ + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + public Builder setRequest( + com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + com.google.showcase.v1beta1.RepeatRequest.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() : request_; + } + } + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.lang.Object bindingUri_ = ""; + /** + *
+     * The URI template the request was bound to server-side.
+     * 
+ * + * string binding_uri = 2; + * @return The bindingUri. + */ + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URI template the request was bound to server-side.
+     * 
+ * + * string binding_uri = 2; + * @return The bytes for bindingUri. + */ + public com.google.protobuf.ByteString + getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URI template the request was bound to server-side.
+     * 
+ * + * string binding_uri = 2; + * @param value The bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bindingUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The URI template the request was bound to server-side.
+     * 
+ * + * string binding_uri = 2; + * @return This builder for chaining. + */ + public Builder clearBindingUri() { + + bindingUri_ = getDefaultInstance().getBindingUri(); + onChanged(); + return this; + } + /** + *
+     * The URI template the request was bound to server-side.
+     * 
+ * + * string binding_uri = 2; + * @param value The bytes for bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bindingUri_ = 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.showcase.v1beta1.RepeatResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatResponse) + private static final com.google.showcase.v1beta1.RepeatResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatResponse(); + } + + public static com.google.showcase.v1beta1.RepeatResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepeatResponse(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.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java new file mode 100644 index 0000000000..9ddd20a4b4 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface RepeatResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * @return The request. + */ + com.google.showcase.v1beta1.RepeatRequest getRequest(); + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder(); + + /** + *
+   * The URI template the request was bound to server-side.
+   * 
+ * + * string binding_uri = 2; + * @return The bindingUri. + */ + java.lang.String getBindingUri(); + /** + *
+   * The URI template the request was bound to server-side.
+   * 
+ * + * string binding_uri = 2; + * @return The bytes for bindingUri. + */ + com.google.protobuf.ByteString + getBindingUriBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java new file mode 100644 index 0000000000..397a926c8d --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * Request message for reporting on a session.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ +public final class ReportSessionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionRequest) + ReportSessionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ReportSessionRequest.newBuilder() to construct. + private ReportSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ReportSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ReportSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReportSessionRequest( + 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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The session to be reported on.
+   * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+   * The session to be reported on.
+   * 
+ * + * string name = 1 [(.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.showcase.v1beta1.ReportSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionRequest other = (com.google.showcase.v1beta1.ReportSessionRequest) 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.showcase.v1beta1.ReportSessionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest 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 reporting on a session.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionRequest) + com.google.showcase.v1beta1.ReportSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionRequest.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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest build() { + com.google.showcase.v1beta1.ReportSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest buildPartial() { + com.google.showcase.v1beta1.ReportSessionRequest result = new com.google.showcase.v1beta1.ReportSessionRequest(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.showcase.v1beta1.ReportSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionRequest other) { + if (other == com.google.showcase.v1beta1.ReportSessionRequest.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.showcase.v1beta1.ReportSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ReportSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The session to be reported on.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The session to be reported on.
+     * 
+ * + * string name = 1 [(.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; + } + } + /** + *
+     * The session to be reported on.
+     * 
+ * + * string name = 1 [(.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; + } + /** + *
+     * The session to be reported on.
+     * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The session to be reported on.
+     * 
+ * + * string name = 1 [(.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.showcase.v1beta1.ReportSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionRequest) + private static final com.google.showcase.v1beta1.ReportSessionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionRequest(); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportSessionRequest(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.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java new file mode 100644 index 0000000000..c27541bfbb --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ReportSessionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The session to be reported on.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The session to be reported on.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java new file mode 100644 index 0000000000..9b83e8a5d9 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java @@ -0,0 +1,1150 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * Response message for reporting on a session.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ +public final class ReportSessionResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionResponse) + ReportSessionResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ReportSessionResponse.newBuilder() to construct. + private ReportSessionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ReportSessionResponse() { + result_ = 0; + testRuns_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ReportSessionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReportSessionResponse( + 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 8: { + int rawValue = input.readEnum(); + + result_ = rawValue; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + testRuns_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + testRuns_.add( + input.readMessage(com.google.showcase.v1beta1.TestRun.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + testRuns_ = java.util.Collections.unmodifiableList(testRuns_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + /** + *
+   * The topline state of the report.
+   * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.ReportSessionResponse.Result} + */ + public enum Result + implements com.google.protobuf.ProtocolMessageEnum { + /** + * RESULT_UNSPECIFIED = 0; + */ + RESULT_UNSPECIFIED(0), + /** + *
+     * The session is complete, and everything passed.
+     * 
+ * + * PASSED = 1; + */ + PASSED(1), + /** + *
+     * The session had an explicit failure.
+     * 
+ * + * FAILED = 2; + */ + FAILED(2), + /** + *
+     * The session is incomplete. This is a failure response.
+     * 
+ * + * INCOMPLETE = 3; + */ + INCOMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** + * RESULT_UNSPECIFIED = 0; + */ + public static final int RESULT_UNSPECIFIED_VALUE = 0; + /** + *
+     * The session is complete, and everything passed.
+     * 
+ * + * PASSED = 1; + */ + public static final int PASSED_VALUE = 1; + /** + *
+     * The session had an explicit failure.
+     * 
+ * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + /** + *
+     * The session is incomplete. This is a failure response.
+     * 
+ * + * INCOMPLETE = 3; + */ + public static final int INCOMPLETE_VALUE = 3; + + + 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 Result 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 Result forNumber(int value) { + switch (value) { + case 0: return RESULT_UNSPECIFIED; + case 1: return PASSED; + case 2: return FAILED; + case 3: return INCOMPLETE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Result> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Result findValueByNumber(int number) { + return Result.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.showcase.v1beta1.ReportSessionResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final Result[] VALUES = values(); + + public static Result 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 Result(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ReportSessionResponse.Result) + } + + public static final int RESULT_FIELD_NUMBER = 1; + private int result_; + /** + *
+   * The state of the report.
+   * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override public int getResultValue() { + return result_; + } + /** + *
+   * The state of the report.
+   * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return The result. + */ + @java.lang.Override public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ReportSessionResponse.Result result = com.google.showcase.v1beta1.ReportSessionResponse.Result.valueOf(result_); + return result == null ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED : result; + } + + public static final int TEST_RUNS_FIELD_NUMBER = 2; + private java.util.List testRuns_; + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List getTestRunsList() { + return testRuns_; + } + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List + getTestRunsOrBuilderList() { + return testRuns_; + } + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public int getTestRunsCount() { + return testRuns_.size(); + } + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + return testRuns_.get(index); + } + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder( + int index) { + return testRuns_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (result_ != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED.getNumber()) { + output.writeEnum(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + output.writeMessage(2, testRuns_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (result_ != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, testRuns_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ReportSessionResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionResponse other = (com.google.showcase.v1beta1.ReportSessionResponse) obj; + + if (result_ != other.result_) return false; + if (!getTestRunsList() + .equals(other.getTestRunsList())) 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) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + result_; + if (getTestRunsCount() > 0) { + hash = (37 * hash) + TEST_RUNS_FIELD_NUMBER; + hash = (53 * hash) + getTestRunsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse 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 reporting on a session.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionResponse) + com.google.showcase.v1beta1.ReportSessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTestRunsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + result_ = 0; + + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + testRunsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse build() { + com.google.showcase.v1beta1.ReportSessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse buildPartial() { + com.google.showcase.v1beta1.ReportSessionResponse result = new com.google.showcase.v1beta1.ReportSessionResponse(this); + int from_bitField0_ = bitField0_; + result.result_ = result_; + if (testRunsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + testRuns_ = java.util.Collections.unmodifiableList(testRuns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.testRuns_ = testRuns_; + } else { + result.testRuns_ = testRunsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ReportSessionResponse) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionResponse other) { + if (other == com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance()) return this; + if (other.result_ != 0) { + setResultValue(other.getResultValue()); + } + if (testRunsBuilder_ == null) { + if (!other.testRuns_.isEmpty()) { + if (testRuns_.isEmpty()) { + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestRunsIsMutable(); + testRuns_.addAll(other.testRuns_); + } + onChanged(); + } + } else { + if (!other.testRuns_.isEmpty()) { + if (testRunsBuilder_.isEmpty()) { + testRunsBuilder_.dispose(); + testRunsBuilder_ = null; + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000001); + testRunsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTestRunsFieldBuilder() : null; + } else { + testRunsBuilder_.addAllMessages(other.testRuns_); + } + } + } + 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.showcase.v1beta1.ReportSessionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ReportSessionResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int result_ = 0; + /** + *
+     * The state of the report.
+     * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override public int getResultValue() { + return result_; + } + /** + *
+     * The state of the report.
+     * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @param value The enum numeric value on the wire for result to set. + * @return This builder for chaining. + */ + public Builder setResultValue(int value) { + + result_ = value; + onChanged(); + return this; + } + /** + *
+     * The state of the report.
+     * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ReportSessionResponse.Result result = com.google.showcase.v1beta1.ReportSessionResponse.Result.valueOf(result_); + return result == null ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED : result; + } + /** + *
+     * The state of the report.
+     * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(com.google.showcase.v1beta1.ReportSessionResponse.Result value) { + if (value == null) { + throw new NullPointerException(); + } + + result_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The state of the report.
+     * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return This builder for chaining. + */ + public Builder clearResult() { + + result_ = 0; + onChanged(); + return this; + } + + private java.util.List testRuns_ = + java.util.Collections.emptyList(); + private void ensureTestRunsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + testRuns_ = new java.util.ArrayList(testRuns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, com.google.showcase.v1beta1.TestRun.Builder, com.google.showcase.v1beta1.TestRunOrBuilder> testRunsBuilder_; + + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsList() { + if (testRunsBuilder_ == null) { + return java.util.Collections.unmodifiableList(testRuns_); + } else { + return testRunsBuilder_.getMessageList(); + } + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public int getTestRunsCount() { + if (testRunsBuilder_ == null) { + return testRuns_.size(); + } else { + return testRunsBuilder_.getCount(); + } + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessage(index); + } + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns( + int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.set(index, value); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.set(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(value); + onChanged(); + } else { + testRunsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns( + int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(index, value); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns( + com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addAllTestRuns( + java.lang.Iterable values) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, testRuns_); + onChanged(); + } else { + testRunsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder clearTestRuns() { + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testRunsBuilder_.clear(); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder removeTestRuns(int index) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.remove(index); + onChanged(); + } else { + testRunsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder getTestRunsBuilder( + int index) { + return getTestRunsFieldBuilder().getBuilder(index); + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder( + int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); } else { + return testRunsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List + getTestRunsOrBuilderList() { + if (testRunsBuilder_ != null) { + return testRunsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(testRuns_); + } + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder() { + return getTestRunsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder( + int index) { + return getTestRunsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + /** + *
+     * The test runs of this session.
+     * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List + getTestRunsBuilderList() { + return getTestRunsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, com.google.showcase.v1beta1.TestRun.Builder, com.google.showcase.v1beta1.TestRunOrBuilder> + getTestRunsFieldBuilder() { + if (testRunsBuilder_ == null) { + testRunsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, com.google.showcase.v1beta1.TestRun.Builder, com.google.showcase.v1beta1.TestRunOrBuilder>( + testRuns_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + testRuns_ = null; + } + return testRunsBuilder_; + } + @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.showcase.v1beta1.ReportSessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionResponse) + private static final com.google.showcase.v1beta1.ReportSessionResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionResponse(); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportSessionResponse(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.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java new file mode 100644 index 0000000000..1b13563414 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ReportSessionResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The state of the report.
+   * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return The enum numeric value on the wire for result. + */ + int getResultValue(); + /** + *
+   * The state of the report.
+   * 
+ * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * @return The result. + */ + com.google.showcase.v1beta1.ReportSessionResponse.Result getResult(); + + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List + getTestRunsList(); + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRun getTestRuns(int index); + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + int getTestRunsCount(); + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List + getTestRunsOrBuilderList(); + /** + *
+   * The test runs of this session.
+   * 
+ * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder( + int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java new file mode 100644 index 0000000000..d03db19025 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java @@ -0,0 +1,1399 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * A chat room.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ +public final class Room extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Room) + RoomOrBuilder { +private static final long serialVersionUID = 0L; + // Use Room.newBuilder() to construct. + private Room(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Room() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Room(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Room( + 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(); + + displayName_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: { + 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 42: { + 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; + } + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + *
+   * The human readable name of the chat room.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+   * The human readable name of the chat room.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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 DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+   * The description of the chat room.
+   * 
+ * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * The description of the chat room.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * The timestamp at which the room was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * The timestamp at which the room was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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_; + } + /** + *
+   * The timestamp at which the room was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * The latest timestamp at which the room was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * The latest timestamp at which the room was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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_; + } + /** + *
+   * The latest timestamp at which the room was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + 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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getUpdateTime()); + } + 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.showcase.v1beta1.Room)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Room other = (com.google.showcase.v1beta1.Room) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDisplayName() + .equals(other.getDisplayName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime() + .equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime() + .equals(other.getUpdateTime())) return false; + } + if (!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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Room parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Room parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Room parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Room parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Room parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room 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 chat room.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Room) + com.google.showcase.v1beta1.RoomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Room.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_ = ""; + + displayName_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Room.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room build() { + com.google.showcase.v1beta1.Room result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room buildPartial() { + com.google.showcase.v1beta1.Room result = new com.google.showcase.v1beta1.Room(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + 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.showcase.v1beta1.Room) { + return mergeFrom((com.google.showcase.v1beta1.Room)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Room other) { + if (other == com.google.showcase.v1beta1.Room.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.showcase.v1beta1.Room parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Room) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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; + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the chat room.
+     * 
+ * + * string name = 1; + * @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 displayName_ = ""; + /** + *
+     * The human readable name of the chat room.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * The human readable name of the chat room.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * The human readable name of the chat room.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + /** + *
+     * The human readable name of the chat room.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * The human readable name of the chat room.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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 description_ = ""; + /** + *
+     * The description of the chat room.
+     * 
+ * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The description of the chat room.
+     * 
+ * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The description of the chat room.
+     * 
+ * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * The description of the chat room.
+     * 
+ * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * The description of the chat room.
+     * 
+ * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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(); + } + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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_; + } + } + /** + *
+     * The timestamp at which the room was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + 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_; + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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(); + } + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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_; + } + } + /** + *
+     * The latest timestamp at which the room was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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_; + } + @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.showcase.v1beta1.Room) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Room) + private static final com.google.showcase.v1beta1.Room DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Room(); + } + + public static com.google.showcase.v1beta1.Room getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Room parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Room(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.showcase.v1beta1.Room getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java new file mode 100644 index 0000000000..b7ebbbad5d --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -0,0 +1,166 @@ +/* + * 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.showcase.v1beta1; + +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 RoomName implements ResourceName { + private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); + private volatile Map fieldValuesMap; + private final String room; + + @Deprecated + protected RoomName() { + room = null; + } + + private RoomName(Builder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + } + + public String getRoom() { + return room; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RoomName of(String room) { + return newBuilder().setRoom(room).build(); + } + + public static String format(String room) { + return newBuilder().setRoom(room).build().toString(); + } + + public static RoomName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); + return of(matchMap.get("room")); + } + + 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 (RoomName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ROOM.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (room != null) { + fieldMapBuilder.put("room", room); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ROOM.instantiate("room", room); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + RoomName that = ((RoomName) o); + return Objects.equals(this.room, that.room); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(room); + return h; + } + + /** Builder for rooms/{room}. */ + public static class Builder { + private String room; + + protected Builder() {} + + public String getRoom() { + return room; + } + + public Builder setRoom(String room) { + this.room = room; + return this; + } + + private Builder(RoomName roomName) { + this.room = roomName.room; + } + + public RoomName build() { + return new RoomName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java new file mode 100644 index 0000000000..28cefbcd18 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java @@ -0,0 +1,123 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface RoomOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Room) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the chat room.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The human readable name of the chat room.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + *
+   * The human readable name of the chat room.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * The description of the chat room.
+   * 
+ * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * The description of the chat room.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * The timestamp at which the room was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + *
+   * The timestamp at which the room was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * The timestamp at which the room was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * The latest timestamp at which the room was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + *
+   * The latest timestamp at which the room was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * The latest timestamp at which the room was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java new file mode 100644 index 0000000000..cb91d593a7 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java @@ -0,0 +1,667 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The operation metadata message for the
+ * google.showcase.v1beta1.Messaging\SearchBlurbs method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ +public final class SearchBlurbsMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + SearchBlurbsMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use SearchBlurbsMetadata.newBuilder() to construct. + private SearchBlurbsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SearchBlurbsMetadata() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SearchBlurbsMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SearchBlurbsMetadata( + 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.rpc.RetryInfo.Builder subBuilder = null; + if (retryInfo_ != null) { + subBuilder = retryInfo_.toBuilder(); + } + retryInfo_ = input.readMessage(com.google.rpc.RetryInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retryInfo_); + retryInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + public static final int RETRY_INFO_FIELD_NUMBER = 1; + private com.google.rpc.RetryInfo retryInfo_; + /** + *
+   * This signals to the client when to next poll for response.
+   * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + * @return Whether the retryInfo field is set. + */ + @java.lang.Override + public boolean hasRetryInfo() { + return retryInfo_ != null; + } + /** + *
+   * This signals to the client when to next poll for response.
+   * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + * @return The retryInfo. + */ + @java.lang.Override + public com.google.rpc.RetryInfo getRetryInfo() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + /** + *
+   * This signals to the client when to next poll for response.
+   * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + @java.lang.Override + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + return getRetryInfo(); + } + + 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 (retryInfo_ != null) { + output.writeMessage(1, getRetryInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retryInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRetryInfo()); + } + 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.showcase.v1beta1.SearchBlurbsMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsMetadata other = (com.google.showcase.v1beta1.SearchBlurbsMetadata) obj; + + if (hasRetryInfo() != other.hasRetryInfo()) return false; + if (hasRetryInfo()) { + if (!getRetryInfo() + .equals(other.getRetryInfo())) 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 (hasRetryInfo()) { + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRetryInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata 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; + } + /** + *
+   * The operation metadata message for the
+   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.showcase.v1beta1.SearchBlurbsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsMetadata.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 (retryInfoBuilder_ == null) { + retryInfo_ = null; + } else { + retryInfo_ = null; + retryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata build() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = new com.google.showcase.v1beta1.SearchBlurbsMetadata(this); + if (retryInfoBuilder_ == null) { + result.retryInfo_ = retryInfo_; + } else { + result.retryInfo_ = retryInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsMetadata) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsMetadata other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance()) return this; + if (other.hasRetryInfo()) { + mergeRetryInfo(other.getRetryInfo()); + } + 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.showcase.v1beta1.SearchBlurbsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.rpc.RetryInfo retryInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, com.google.rpc.RetryInfo.Builder, com.google.rpc.RetryInfoOrBuilder> retryInfoBuilder_; + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + * @return Whether the retryInfo field is set. + */ + public boolean hasRetryInfo() { + return retryInfoBuilder_ != null || retryInfo_ != null; + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + * @return The retryInfo. + */ + public com.google.rpc.RetryInfo getRetryInfo() { + if (retryInfoBuilder_ == null) { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } else { + return retryInfoBuilder_.getMessage(); + } + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryInfo_ = value; + onChanged(); + } else { + retryInfoBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo( + com.google.rpc.RetryInfo.Builder builderForValue) { + if (retryInfoBuilder_ == null) { + retryInfo_ = builderForValue.build(); + onChanged(); + } else { + retryInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (retryInfo_ != null) { + retryInfo_ = + com.google.rpc.RetryInfo.newBuilder(retryInfo_).mergeFrom(value).buildPartial(); + } else { + retryInfo_ = value; + } + onChanged(); + } else { + retryInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder clearRetryInfo() { + if (retryInfoBuilder_ == null) { + retryInfo_ = null; + onChanged(); + } else { + retryInfo_ = null; + retryInfoBuilder_ = null; + } + + return this; + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { + + onChanged(); + return getRetryInfoFieldBuilder().getBuilder(); + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + if (retryInfoBuilder_ != null) { + return retryInfoBuilder_.getMessageOrBuilder(); + } else { + return retryInfo_ == null ? + com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + } + /** + *
+     * This signals to the client when to next poll for response.
+     * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, com.google.rpc.RetryInfo.Builder, com.google.rpc.RetryInfoOrBuilder> + getRetryInfoFieldBuilder() { + if (retryInfoBuilder_ == null) { + retryInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, com.google.rpc.RetryInfo.Builder, com.google.rpc.RetryInfoOrBuilder>( + getRetryInfo(), + getParentForChildren(), + isClean()); + retryInfo_ = null; + } + return retryInfoBuilder_; + } + @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.showcase.v1beta1.SearchBlurbsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsMetadata) + private static final com.google.showcase.v1beta1.SearchBlurbsMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsMetadata(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchBlurbsMetadata(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.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java new file mode 100644 index 0000000000..d8bfeb513d --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SearchBlurbsMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * This signals to the client when to next poll for response.
+   * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + * @return Whether the retryInfo field is set. + */ + boolean hasRetryInfo(); + /** + *
+   * This signals to the client when to next poll for response.
+   * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + * @return The retryInfo. + */ + com.google.rpc.RetryInfo getRetryInfo(); + /** + *
+   * This signals to the client when to next poll for response.
+   * 
+ * + * .google.rpc.RetryInfo retry_info = 1; + */ + com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java new file mode 100644 index 0000000000..dffbdbea44 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java @@ -0,0 +1,1052 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ +public final class SearchBlurbsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsRequest) + SearchBlurbsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use SearchBlurbsRequest.newBuilder() to construct. + private SearchBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SearchBlurbsRequest() { + query_ = ""; + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SearchBlurbsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SearchBlurbsRequest( + 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(); + + query_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object query_; + /** + *
+   * The query used to search for blurbs containing to words of this string.
+   * Only posts that contain an exact match of a queried word will be returned.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + *
+   * The query used to search for blurbs containing to words of this string.
+   * Only posts that contain an exact match of a queried word will be returned.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + *
+   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+   * rooms and all profiles.
+   * 
+ * + * string parent = 2 [(.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; + } + } + /** + *
+   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+   * rooms and all profiles.
+   * 
+ * + * string parent = 2 [(.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 = 3; + private int pageSize_; + /** + *
+   * The maximum number of blurbs return. Server may return fewer
+   * blurbs than requested. If unspecified, server will pick an appropriate
+   * default.
+   * 
+ * + * int32 page_size = 3; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + *
+   * The value of
+   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+   * 
+ * + * string page_token = 4; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The value of
+   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+   * 
+ * + * string page_token = 4; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsRequest other = (com.google.showcase.v1beta1.SearchBlurbsRequest) obj; + + if (!getQuery() + .equals(other.getQuery())) return false; + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.showcase.v1beta1.SearchBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsRequest.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(); + query_ = ""; + + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest build() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = new com.google.showcase.v1beta1.SearchBlurbsRequest(this); + result.query_ = query_; + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance()) return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SearchBlurbsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object query_ = ""; + /** + *
+     * The query used to search for blurbs containing to words of this string.
+     * Only posts that contain an exact match of a queried word will be returned.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The query used to search for blurbs containing to words of this string.
+     * Only posts that contain an exact match of a queried word will be returned.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for query. + */ + public com.google.protobuf.ByteString + getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The query used to search for blurbs containing to words of this string.
+     * Only posts that contain an exact match of a queried word will be returned.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + *
+     * The query used to search for blurbs containing to words of this string.
+     * Only posts that contain an exact match of a queried word will be returned.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + *
+     * The query used to search for blurbs containing to words of this string.
+     * Only posts that contain an exact match of a queried word will be returned.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+     * rooms and all profiles.
+     * 
+ * + * string parent = 2 [(.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; + } + } + /** + *
+     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+     * rooms and all profiles.
+     * 
+ * + * string parent = 2 [(.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; + } + } + /** + *
+     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+     * rooms and all profiles.
+     * 
+ * + * string parent = 2 [(.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; + } + /** + *
+     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+     * rooms and all profiles.
+     * 
+ * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+     * rooms and all profiles.
+     * 
+ * + * string parent = 2 [(.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_ ; + /** + *
+     * The maximum number of blurbs return. Server may return fewer
+     * blurbs than requested. If unspecified, server will pick an appropriate
+     * default.
+     * 
+ * + * int32 page_size = 3; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of blurbs return. Server may return fewer
+     * blurbs than requested. If unspecified, server will pick an appropriate
+     * default.
+     * 
+ * + * int32 page_size = 3; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of blurbs return. Server may return fewer
+     * blurbs than requested. If unspecified, server will pick an appropriate
+     * default.
+     * 
+ * + * int32 page_size = 3; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The value of
+     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+     * 
+ * + * string page_token = 4; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The value of
+     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+     * 
+ * + * string page_token = 4; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The value of
+     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+     * 
+ * + * string page_token = 4; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The value of
+     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+     * 
+ * + * string page_token = 4; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The value of
+     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+     * returned from the previous call to
+     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+     * 
+ * + * string page_token = 4; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsRequest) + private static final com.google.showcase.v1beta1.SearchBlurbsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchBlurbsRequest(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.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..f3595e10a6 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SearchBlurbsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The query used to search for blurbs containing to words of this string.
+   * Only posts that contain an exact match of a queried word will be returned.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The query. + */ + java.lang.String getQuery(); + /** + *
+   * The query used to search for blurbs containing to words of this string.
+   * Only posts that contain an exact match of a queried word will be returned.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for query. + */ + com.google.protobuf.ByteString + getQueryBytes(); + + /** + *
+   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+   * rooms and all profiles.
+   * 
+ * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
+   * rooms and all profiles.
+   * 
+ * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of blurbs return. Server may return fewer
+   * blurbs than requested. If unspecified, server will pick an appropriate
+   * default.
+   * 
+ * + * int32 page_size = 3; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The value of
+   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+   * 
+ * + * string page_token = 4; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The value of
+   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
+   * returned from the previous call to
+   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
+   * 
+ * + * string page_token = 4; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java new file mode 100644 index 0000000000..92d87c30de --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java @@ -0,0 +1,1061 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The operation response message for the
+ * google.showcase.v1beta1.Messaging\SearchBlurbs method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ +public final class SearchBlurbsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsResponse) + SearchBlurbsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use SearchBlurbsResponse.newBuilder() to construct. + private SearchBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SearchBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SearchBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SearchBlurbsResponse( + 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)) { + blurbs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + blurbs_.add( + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + private java.util.List blurbs_; + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( + int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+   * retrieve the next page of results.
+   * 
+ * + * 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 next page of results.
+   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+   * retrieve the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsResponse other = (com.google.showcase.v1beta1.SearchBlurbsResponse) obj; + + if (!getBlurbsList() + .equals(other.getBlurbsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse 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; + } + /** + *
+   * The operation response message for the
+   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.showcase.v1beta1.SearchBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getBlurbsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + blurbsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse build() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = new com.google.showcase.v1beta1.SearchBlurbsResponse(this); + int from_bitField0_ = bitField0_; + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance()) return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBlurbsFieldBuilder() : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SearchBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List blurbs_ = + java.util.Collections.emptyList(); + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbsBuilder_; + + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs( + int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs( + int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs( + int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs( + com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs( + int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder( + int index) { + return getBlurbsFieldBuilder().getBuilder(index); + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( + int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return getBlurbsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder( + int index) { + return getBlurbsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + /** + *
+     * Blurbs that matched the search query.
+     * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsBuilderList() { + return getBlurbsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+     * retrieve the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+     * retrieve the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+     * retrieve the next page of results.
+     * 
+ * + * 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 next page of results.
+     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+     * retrieve the next page of results.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token to retrieve next page of results.
+     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+     * retrieve the next page of results.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsResponse) + private static final com.google.showcase.v1beta1.SearchBlurbsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchBlurbsResponse(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.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..a7c08ee712 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SearchBlurbsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List + getBlurbsList(); + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List + getBlurbsOrBuilderList(); + /** + *
+   * Blurbs that matched the search query.
+   * 
+ * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+   * retrieve the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token to retrieve next page of results.
+   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
+   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
+   * retrieve the next page of results.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java new file mode 100644 index 0000000000..d00a32be06 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java @@ -0,0 +1,678 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ +public final class SendBlurbsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SendBlurbsResponse) + SendBlurbsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use SendBlurbsResponse.newBuilder() to construct. + private SendBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SendBlurbsResponse() { + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SendBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SendBlurbsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + names_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + names_.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)) { + names_ = names_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + public static final int NAMES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList names_; + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList + getNamesList() { + return names_; + } + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString + getNamesBytes(int index) { + return names_.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 < names_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, names_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < names_.size(); i++) { + dataSize += computeStringSizeNoTag(names_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamesList().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.showcase.v1beta1.SendBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SendBlurbsResponse other = (com.google.showcase.v1beta1.SendBlurbsResponse) obj; + + if (!getNamesList() + .equals(other.getNamesList())) 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 (getNamesCount() > 0) { + hash = (37 * hash) + NAMES_FIELD_NUMBER; + hash = (53 * hash) + getNamesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse 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; + } + /** + *
+   * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SendBlurbsResponse) + com.google.showcase.v1beta1.SendBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SendBlurbsResponse.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(); + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse build() { + com.google.showcase.v1beta1.SendBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SendBlurbsResponse result = new com.google.showcase.v1beta1.SendBlurbsResponse(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + names_ = names_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.names_ = names_; + 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.showcase.v1beta1.SendBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SendBlurbsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SendBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance()) return this; + if (!other.names_.isEmpty()) { + if (names_.isEmpty()) { + names_ = other.names_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNamesIsMutable(); + names_.addAll(other.names_); + } + 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.showcase.v1beta1.SendBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SendBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + names_ = new com.google.protobuf.LazyStringArrayList(names_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList + getNamesList() { + return names_.getUnmodifiableView(); + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString + getNamesBytes(int index) { + return names_.getByteString(index); + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @param index The index to set the value at. + * @param value The names to set. + * @return This builder for chaining. + */ + public Builder setNames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @param value The names to add. + * @return This builder for chaining. + */ + public Builder addNames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.add(value); + onChanged(); + return this; + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @param values The names to add. + * @return This builder for chaining. + */ + public Builder addAllNames( + java.lang.Iterable values) { + ensureNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, names_); + onChanged(); + return this; + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @return This builder for chaining. + */ + public Builder clearNames() { + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The names of successful blurb creations.
+     * 
+ * + * repeated string names = 1; + * @param value The bytes of the names to add. + * @return This builder for chaining. + */ + public Builder addNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamesIsMutable(); + names_.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.showcase.v1beta1.SendBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SendBlurbsResponse) + private static final com.google.showcase.v1beta1.SendBlurbsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SendBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SendBlurbsResponse(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.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..3de7bfaad7 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java @@ -0,0 +1,50 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SendBlurbsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SendBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @return A list containing the names. + */ + java.util.List + getNamesList(); + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @return The count of names. + */ + int getNamesCount(); + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @param index The index of the element to return. + * @return The names at the given index. + */ + java.lang.String getNames(int index); + /** + *
+   * The names of successful blurb creations.
+   * 
+ * + * repeated string names = 1; + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + com.google.protobuf.ByteString + getNamesBytes(int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java new file mode 100644 index 0000000000..d90689e15a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java @@ -0,0 +1,1979 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.Sequence} + */ +public final class Sequence extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence) + SequenceOrBuilder { +private static final long serialVersionUID = 0L; + // Use Sequence.newBuilder() to construct. + private Sequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Sequence() { + name_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Sequence(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Sequence( + 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: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage(com.google.showcase.v1beta1.Sequence.Response.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, com.google.showcase.v1beta1.Sequence.Builder.class); + } + + public interface ResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The status to return for an individual attempt.
+     * 
+ * + * .google.rpc.Status status = 1; + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + *
+     * The status to return for an individual attempt.
+     * 
+ * + * .google.rpc.Status status = 1; + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + *
+     * The status to return for an individual attempt.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + *
+     * The amount of time to delay sending the response.
+     * 
+ * + * .google.protobuf.Duration delay = 2; + * @return Whether the delay field is set. + */ + boolean hasDelay(); + /** + *
+     * The amount of time to delay sending the response.
+     * 
+ * + * .google.protobuf.Duration delay = 2; + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + /** + *
+     * The amount of time to delay sending the response.
+     * 
+ * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + } + /** + *
+   * A server response to an RPC Attempt in a sequence.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Response extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Response() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Response(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Response( + 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.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (delay_ != null) { + subBuilder = delay_.toBuilder(); + } + delay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(delay_); + delay_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + /** + *
+     * The status to return for an individual attempt.
+     * 
+ * + * .google.rpc.Status status = 1; + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + *
+     * The status to return for an individual attempt.
+     * 
+ * + * .google.rpc.Status status = 1; + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + *
+     * The status to return for an individual attempt.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + /** + *
+     * The amount of time to delay sending the response.
+     * 
+ * + * .google.protobuf.Duration delay = 2; + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return delay_ != null; + } + /** + *
+     * The amount of time to delay sending the response.
+     * 
+ * + * .google.protobuf.Duration delay = 2; + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + /** + *
+     * The amount of time to delay sending the response.
+     * 
+ * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return getDelay(); + } + + 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 (status_ != null) { + output.writeMessage(1, getStatus()); + } + if (delay_ != null) { + output.writeMessage(2, getDelay()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getStatus()); + } + if (delay_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDelay()); + } + 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.showcase.v1beta1.Sequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence.Response other = (com.google.showcase.v1beta1.Sequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus() + .equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay() + .equals(other.getDelay())) 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 (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response 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 server response to an RPC Attempt in a sequence.
+     * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence.Response) + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.Response.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 (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + if (delayBuilder_ == null) { + delay_ = null; + } else { + delay_ = null; + delayBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response build() { + com.google.showcase.v1beta1.Sequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response buildPartial() { + com.google.showcase.v1beta1.Sequence.Response result = new com.google.showcase.v1beta1.Sequence.Response(this); + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (delayBuilder_ == null) { + result.delay_ = delay_; + } else { + result.delay_ = delayBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Sequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.Sequence.Response)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence.Response other) { + if (other == com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()) return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + 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.showcase.v1beta1.Sequence.Response parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Sequence.Response) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder setStatus( + com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = + com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? + com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + *
+       * The status to return for an individual attempt.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getStatus(), + getParentForChildren(), + isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> delayBuilder_; + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return delayBuilder_ != null || delay_ != null; + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + onChanged(); + } else { + delayBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay( + com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + onChanged(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (delay_ != null) { + delay_ = + com.google.protobuf.Duration.newBuilder(delay_).mergeFrom(value).buildPartial(); + } else { + delay_ = value; + } + onChanged(); + } else { + delayBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + if (delayBuilder_ == null) { + delay_ = null; + onChanged(); + } else { + delay_ = null; + delayBuilder_ = null; + } + + return this; + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + + onChanged(); + return getDelayFieldBuilder().getBuilder(); + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + /** + *
+       * The amount of time to delay sending the response.
+       * 
+ * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getDelay(), + getParentForChildren(), + isClean()); + delay_ = null; + } + return delayBuilder_; + } + @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.showcase.v1beta1.Sequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence.Response) + private static final com.google.showcase.v1beta1.Sequence.Response DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence.Response(); + } + + public static com.google.showcase.v1beta1.Sequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Response(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.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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 RESPONSES_FIELD_NUMBER = 2; + private java.util.List responses_; + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + return responses_.get(index); + } + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(2, responses_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, responses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Sequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence other = (com.google.showcase.v1beta1.Sequence) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getResponsesList() + .equals(other.getResponsesList())) 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 (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Sequence parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Sequence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Sequence parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Sequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.Sequence} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence) + com.google.showcase.v1beta1.SequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, com.google.showcase.v1beta1.Sequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence build() { + com.google.showcase.v1beta1.Sequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence buildPartial() { + com.google.showcase.v1beta1.Sequence result = new com.google.showcase.v1beta1.Sequence(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Sequence) { + return mergeFrom((com.google.showcase.v1beta1.Sequence)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence other) { + if (other == com.google.showcase.v1beta1.Sequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResponsesFieldBuilder() : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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.showcase.v1beta1.Sequence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Sequence) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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.util.List responses_ = + java.util.Collections.emptyList(); + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, com.google.showcase.v1beta1.Sequence.Response.Builder, com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> responsesBuilder_; + + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder() { + return getResponsesFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + /** + *
+     * Sequence of responses to return in order for each attempt. If empty, the
+     * default response is an immediate OK.
+     * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, com.google.showcase.v1beta1.Sequence.Response.Builder, com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, com.google.showcase.v1beta1.Sequence.Response.Builder, com.google.showcase.v1beta1.Sequence.ResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + @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.showcase.v1beta1.Sequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence) + private static final com.google.showcase.v1beta1.Sequence DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence(); + } + + public static com.google.showcase.v1beta1.Sequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sequence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Sequence(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.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java new file mode 100644 index 0000000000..067bb15adb --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 SequenceName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceName() { + sequence = null; + } + + private SequenceName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SequenceName that = ((SequenceName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceName sequenceName) { + this.sequence = sequenceName.sequence; + } + + public SequenceName build() { + return new SequenceName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java new file mode 100644 index 0000000000..9aa5beab37 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface SequenceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List + getResponsesList(); + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.Response getResponses(int index); + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + int getResponsesCount(); + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List + getResponsesOrBuilderList(); + /** + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder( + int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java new file mode 100644 index 0000000000..d3c0d424eb --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java @@ -0,0 +1,184 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public final class SequenceOuterClass { + private SequenceOuterClass() {} + 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_showcase_v1beta1_Sequence_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n-schema/google/showcase/v1beta1/sequenc" + + "e.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\036google/prot" + + "obuf/duration.proto\032\033google/protobuf/emp" + + "ty.proto\032\037google/protobuf/timestamp.prot" + + "o\032\027google/rpc/status.proto\"\363\001\n\010Sequence\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\003\022=\n\tresponses\030\002 \003(\0132*." + + "google.showcase.v1beta1.Sequence.Respons" + + "e\032X\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google.r" + + "pc.Status\022(\n\005delay\030\002 \001(\0132\031.google.protob" + + "uf.Duration:;\352A8\n showcase.googleapis.co" + + "m/Sequence\022\024sequences/{sequence}\"\233\003\n\016Seq" + + "uenceReport\022\021\n\004name\030\001 \001(\tB\003\340A\003\022A\n\010attemp" + + "ts\030\002 \003(\0132/.google.showcase.v1beta1.Seque" + + "nceReport.Attempt\032\340\001\n\007Attempt\022\026\n\016attempt" + + "_number\030\001 \001(\005\0224\n\020attempt_deadline\030\002 \001(\0132" + + "\032.google.protobuf.Timestamp\0221\n\rresponse_" + + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\0220" + + "\n\rattempt_delay\030\004 \001(\0132\031.google.protobuf." + + "Duration\022\"\n\006status\030\005 \001(\0132\022.google.rpc.St" + + "atus:P\352AM\n&showcase.googleapis.com/Seque" + + "nceReport\022#sequences/{sequence}/sequence" + + "Report\"L\n\025CreateSequenceRequest\0223\n\010seque" + + "nce\030\001 \001(\0132!.google.showcase.v1beta1.Sequ" + + "ence\"P\n\026AttemptSequenceRequest\0226\n\004name\030\001" + + " \001(\tB(\372A\"\n showcase.googleapis.com/Seque" + + "nce\340A\002\"X\n\030GetSequenceReportRequest\022<\n\004na" + + "me\030\001 \001(\tB.\372A(\n&showcase.googleapis.com/S" + + "equenceReport\340A\0022\364\003\n\017SequenceService\022\224\001\n" + + "\016CreateSequence\022..google.showcase.v1beta" + + "1.CreateSequenceRequest\032!.google.showcas" + + "e.v1beta1.Sequence\"/\202\323\344\223\002\036\"\022/v1beta1/seq" + + "uences:\010sequence\332A\010sequence\022\252\001\n\021GetSeque" + + "nceReport\0221.google.showcase.v1beta1.GetS" + + "equenceReportRequest\032\'.google.showcase.v" + + "1beta1.SequenceReport\"9\202\323\344\223\002,\022*/v1beta1/" + + "{name=sequences/*/sequenceReport}\332A\004name" + + "\022\211\001\n\017AttemptSequence\022/.google.showcase.v" + + "1beta1.AttemptSequenceRequest\032\026.google.p" + + "rotobuf.Empty\"-\202\323\344\223\002 \"\033/v1beta1/{name=se" + + "quences/*}:\001*\332A\004name\032\021\312A\016localhost:7469B" + + "q\n\033com.google.showcase.v1beta1P\001Z4github" + + ".com/googleapis/gapic-showcase/server/ge" + + "nproto\352\002\031Google::Showcase::V1beta1b\006prot" + + "o3" + }; + 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.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Sequence_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Sequence_descriptor, + new java.lang.String[] { "Name", "Responses", }); + internal_static_google_showcase_v1beta1_Sequence_Response_descriptor = + internal_static_google_showcase_v1beta1_Sequence_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Sequence_Response_descriptor, + new java.lang.String[] { "Status", "Delay", }); + internal_static_google_showcase_v1beta1_SequenceReport_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SequenceReport_descriptor, + new java.lang.String[] { "Name", "Attempts", }); + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor = + internal_static_google_showcase_v1beta1_SequenceReport_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor, + new java.lang.String[] { "AttemptNumber", "AttemptDeadline", "ResponseTime", "AttemptDelay", "Status", }); + internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor, + new java.lang.String[] { "Sequence", }); + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor, + new java.lang.String[] { "Name", }); + 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.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + 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.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java new file mode 100644 index 0000000000..768c155ea3 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java @@ -0,0 +1,2602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.SequenceReport} + */ +public final class SequenceReport extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport) + SequenceReportOrBuilder { +private static final long serialVersionUID = 0L; + // Use SequenceReport.newBuilder() to construct. + private SequenceReport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SequenceReport(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SequenceReport( + 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: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attempts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + attempts_.add( + input.readMessage(com.google.showcase.v1beta1.SequenceReport.Attempt.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + public interface AttemptOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The attempt number - starting at 0.
+     * 
+ * + * int32 attempt_number = 1; + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + *
+     * The deadline dictated by the attempt to the server.
+     * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + /** + *
+     * The deadline dictated by the attempt to the server.
+     * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + /** + *
+     * The deadline dictated by the attempt to the server.
+     * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + *
+     * The time that the server responded to the RPC attempt. Used for
+     * calculating attempt_delay.
+     * 
+ * + * .google.protobuf.Timestamp response_time = 3; + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + /** + *
+     * The time that the server responded to the RPC attempt. Used for
+     * calculating attempt_delay.
+     * 
+ * + * .google.protobuf.Timestamp response_time = 3; + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + /** + *
+     * The time that the server responded to the RPC attempt. Used for
+     * calculating attempt_delay.
+     * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + *
+     * The server perceived delay between sending the last response and
+     * receiving this attempt. Used for validating attempt delay backoff.
+     * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + /** + *
+     * The server perceived delay between sending the last response and
+     * receiving this attempt. Used for validating attempt delay backoff.
+     * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + /** + *
+     * The server perceived delay between sending the last response and
+     * receiving this attempt. Used for validating attempt delay backoff.
+     * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + *
+     * The status returned to the attempt.
+     * 
+ * + * .google.rpc.Status status = 5; + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + *
+     * The status returned to the attempt.
+     * 
+ * + * .google.rpc.Status status = 5; + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + *
+     * The status returned to the attempt.
+     * 
+ * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + /** + *
+   * Contains metrics on individual RPC Attempts in a sequence.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Attempt extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Attempt() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Attempt(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Attempt( + 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 8: { + + attemptNumber_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (attemptDeadline_ != null) { + subBuilder = attemptDeadline_.toBuilder(); + } + attemptDeadline_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attemptDeadline_); + attemptDeadline_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (responseTime_ != null) { + subBuilder = responseTime_.toBuilder(); + } + responseTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(responseTime_); + responseTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (attemptDelay_ != null) { + subBuilder = attemptDelay_.toBuilder(); + } + attemptDelay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attemptDelay_); + attemptDelay_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_; + /** + *
+     * The attempt number - starting at 0.
+     * 
+ * + * int32 attempt_number = 1; + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + /** + *
+     * The deadline dictated by the attempt to the server.
+     * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return attemptDeadline_ != null; + } + /** + *
+     * The deadline dictated by the attempt to the server.
+     * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : attemptDeadline_; + } + /** + *
+     * The deadline dictated by the attempt to the server.
+     * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return getAttemptDeadline(); + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + /** + *
+     * The time that the server responded to the RPC attempt. Used for
+     * calculating attempt_delay.
+     * 
+ * + * .google.protobuf.Timestamp response_time = 3; + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return responseTime_ != null; + } + /** + *
+     * The time that the server responded to the RPC attempt. Used for
+     * calculating attempt_delay.
+     * 
+ * + * .google.protobuf.Timestamp response_time = 3; + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : responseTime_; + } + /** + *
+     * The time that the server responded to the RPC attempt. Used for
+     * calculating attempt_delay.
+     * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return getResponseTime(); + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + /** + *
+     * The server perceived delay between sending the last response and
+     * receiving this attempt. Used for validating attempt delay backoff.
+     * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return attemptDelay_ != null; + } + /** + *
+     * The server perceived delay between sending the last response and
+     * receiving this attempt. Used for validating attempt delay backoff.
+     * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : attemptDelay_; + } + /** + *
+     * The server perceived delay between sending the last response and
+     * receiving this attempt. Used for validating attempt delay backoff.
+     * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return getAttemptDelay(); + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + /** + *
+     * The status returned to the attempt.
+     * 
+ * + * .google.rpc.Status status = 5; + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + *
+     * The status returned to the attempt.
+     * 
+ * + * .google.rpc.Status status = 5; + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + *
+     * The status returned to the attempt.
+     * 
+ * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + 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 (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (attemptDeadline_ != null) { + output.writeMessage(2, getAttemptDeadline()); + } + if (responseTime_ != null) { + output.writeMessage(3, getResponseTime()); + } + if (attemptDelay_ != null) { + output.writeMessage(4, getAttemptDelay()); + } + if (status_ != null) { + output.writeMessage(5, getStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, attemptNumber_); + } + if (attemptDeadline_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAttemptDeadline()); + } + if (responseTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getResponseTime()); + } + if (attemptDelay_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAttemptDelay()); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getStatus()); + } + 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.showcase.v1beta1.SequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport.Attempt other = (com.google.showcase.v1beta1.SequenceReport.Attempt) obj; + + if (getAttemptNumber() + != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline() + .equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime() + .equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay() + .equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus() + .equals(other.getStatus())) 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) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt 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; + } + /** + *
+     * Contains metrics on individual RPC Attempts in a sequence.
+     * 
+ * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.Attempt.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(); + attemptNumber_ = 0; + + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = null; + } else { + attemptDeadline_ = null; + attemptDeadlineBuilder_ = null; + } + if (responseTimeBuilder_ == null) { + responseTime_ = null; + } else { + responseTime_ = null; + responseTimeBuilder_ = null; + } + if (attemptDelayBuilder_ == null) { + attemptDelay_ = null; + } else { + attemptDelay_ = null; + attemptDelayBuilder_ = null; + } + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt build() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = new com.google.showcase.v1beta1.SequenceReport.Attempt(this); + result.attemptNumber_ = attemptNumber_; + if (attemptDeadlineBuilder_ == null) { + result.attemptDeadline_ = attemptDeadline_; + } else { + result.attemptDeadline_ = attemptDeadlineBuilder_.build(); + } + if (responseTimeBuilder_ == null) { + result.responseTime_ = responseTime_; + } else { + result.responseTime_ = responseTimeBuilder_.build(); + } + if (attemptDelayBuilder_ == null) { + result.attemptDelay_ = attemptDelay_; + } else { + result.attemptDelay_ = attemptDelayBuilder_.build(); + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport.Attempt)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport.Attempt other) { + if (other == com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()) return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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.showcase.v1beta1.SequenceReport.Attempt parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SequenceReport.Attempt) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int attemptNumber_ ; + /** + *
+       * The attempt number - starting at 0.
+       * 
+ * + * int32 attempt_number = 1; + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + /** + *
+       * The attempt number - starting at 0.
+       * 
+ * + * int32 attempt_number = 1; + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + onChanged(); + return this; + } + /** + *
+       * The attempt number - starting at 0.
+       * 
+ * + * int32 attempt_number = 1; + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> attemptDeadlineBuilder_; + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return attemptDeadlineBuilder_ != null || attemptDeadline_ != null; + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + onChanged(); + } else { + attemptDeadlineBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + onChanged(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (attemptDeadline_ != null) { + attemptDeadline_ = + com.google.protobuf.Timestamp.newBuilder(attemptDeadline_).mergeFrom(value).buildPartial(); + } else { + attemptDeadline_ = value; + } + onChanged(); + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = null; + onChanged(); + } else { + attemptDeadline_ = null; + attemptDeadlineBuilder_ = null; + } + + return this; + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + + onChanged(); + return getAttemptDeadlineFieldBuilder().getBuilder(); + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : attemptDeadline_; + } + } + /** + *
+       * The deadline dictated by the attempt to the server.
+       * 
+ * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), + getParentForChildren(), + isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> responseTimeBuilder_; + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return responseTimeBuilder_ != null || responseTime_ != null; + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + onChanged(); + } else { + responseTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + onChanged(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (responseTime_ != null) { + responseTime_ = + com.google.protobuf.Timestamp.newBuilder(responseTime_).mergeFrom(value).buildPartial(); + } else { + responseTime_ = value; + } + onChanged(); + } else { + responseTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + if (responseTimeBuilder_ == null) { + responseTime_ = null; + onChanged(); + } else { + responseTime_ = null; + responseTimeBuilder_ = null; + } + + return this; + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + + onChanged(); + return getResponseTimeFieldBuilder().getBuilder(); + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : responseTime_; + } + } + /** + *
+       * The time that the server responded to the RPC attempt. Used for
+       * calculating attempt_delay.
+       * 
+ * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), + getParentForChildren(), + isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> attemptDelayBuilder_; + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return attemptDelayBuilder_ != null || attemptDelay_ != null; + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + onChanged(); + } else { + attemptDelayBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay( + com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + onChanged(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (attemptDelay_ != null) { + attemptDelay_ = + com.google.protobuf.Duration.newBuilder(attemptDelay_).mergeFrom(value).buildPartial(); + } else { + attemptDelay_ = value; + } + onChanged(); + } else { + attemptDelayBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = null; + onChanged(); + } else { + attemptDelay_ = null; + attemptDelayBuilder_ = null; + } + + return this; + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + + onChanged(); + return getAttemptDelayFieldBuilder().getBuilder(); + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : attemptDelay_; + } + } + /** + *
+       * The server perceived delay between sending the last response and
+       * receiving this attempt. Used for validating attempt delay backoff.
+       * 
+ * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), + getParentForChildren(), + isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + public Builder setStatus( + com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = + com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? + com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + *
+       * The status returned to the attempt.
+       * 
+ * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getStatus(), + getParentForChildren(), + isClean()); + status_ = null; + } + return statusBuilder_; + } + @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.showcase.v1beta1.SequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport.Attempt) + private static final com.google.showcase.v1beta1.SequenceReport.Attempt DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Attempt(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.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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 ATTEMPTS_FIELD_NUMBER = 2; + private java.util.List attempts_; + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List getAttemptsList() { + return attempts_; + } + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsOrBuilderList() { + return attempts_; + } + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, attempts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport other = (com.google.showcase.v1beta1.SequenceReport) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getAttemptsList() + .equals(other.getAttemptsList())) 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 (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.SequenceReport} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport) + com.google.showcase.v1beta1.SequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAttemptsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport build() { + com.google.showcase.v1beta1.SequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport buildPartial() { + com.google.showcase.v1beta1.SequenceReport result = new com.google.showcase.v1beta1.SequenceReport(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport other) { + if (other == com.google.showcase.v1beta1.SequenceReport.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000001); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAttemptsFieldBuilder() : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + 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.showcase.v1beta1.SequenceReport parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SequenceReport) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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; + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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.util.List attempts_ = + java.util.Collections.emptyList(); + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + attempts_ = new java.util.ArrayList(attempts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> attemptsBuilder_; + + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder().getBuilder(index); + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder() { + return getAttemptsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + /** + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return getAttemptsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + getAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder>( + attempts_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + @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.showcase.v1beta1.SequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport) + private static final com.google.showcase.v1beta1.SequenceReport DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport(); + } + + public static com.google.showcase.v1beta1.SequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SequenceReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SequenceReport(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.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java new file mode 100644 index 0000000000..80742478a3 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 SequenceReportName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceReportName() { + sequence = null; + } + + private SequenceReportName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceReportName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SequenceReportName that = ((SequenceReportName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}/sequenceReport. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceReportName sequenceReportName) { + this.sequence = sequenceReportName.sequence; + } + + public SequenceReportName build() { + return new SequenceReportName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java new file mode 100644 index 0000000000..287d6d4661 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface SequenceReportOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsList(); + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index); + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + /** + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java new file mode 100644 index 0000000000..3da8c29963 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java @@ -0,0 +1,879 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * A session is a suite of tests, generally being made in the context
+ * of testing code generation.
+ * A session defines tests it may expect, based on which version of the
+ * code generation spec is in use.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ +public final class Session extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Session) + SessionOrBuilder { +private static final long serialVersionUID = 0L; + // Use Session.newBuilder() to construct. + private Session(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Session() { + name_ = ""; + version_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Session(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Session( + 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 16: { + int rawValue = input.readEnum(); + + version_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, com.google.showcase.v1beta1.Session.Builder.class); + } + + /** + *
+   * The specification versions understood by Showcase.
+   * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.Session.Version} + */ + public enum Version + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unspecified version. If passed on creation, the session will default
+     * to using the latest stable release.
+     * 
+ * + * VERSION_UNSPECIFIED = 0; + */ + VERSION_UNSPECIFIED(0), + /** + *
+     * The latest v1. Currently, this is v1.0.
+     * 
+ * + * V1_LATEST = 1; + */ + V1_LATEST(1), + /** + *
+     * v1.0. (Until the spec is "GA", this will be a moving target.)
+     * 
+ * + * V1_0 = 2; + */ + V1_0(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unspecified version. If passed on creation, the session will default
+     * to using the latest stable release.
+     * 
+ * + * VERSION_UNSPECIFIED = 0; + */ + public static final int VERSION_UNSPECIFIED_VALUE = 0; + /** + *
+     * The latest v1. Currently, this is v1.0.
+     * 
+ * + * V1_LATEST = 1; + */ + public static final int V1_LATEST_VALUE = 1; + /** + *
+     * v1.0. (Until the spec is "GA", this will be a moving target.)
+     * 
+ * + * V1_0 = 2; + */ + public static final int V1_0_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Version 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 Version forNumber(int value) { + switch (value) { + case 0: return VERSION_UNSPECIFIED; + case 1: return V1_LATEST; + case 2: return V1_0; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Version> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Version findValueByNumber(int number) { + return Version.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.showcase.v1beta1.Session.getDescriptor().getEnumTypes().get(0); + } + + private static final Version[] VALUES = values(); + + public static Version 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 Version(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Session.Version) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the session. The ID must conform to ^[a-z]+$
+   * If this is not provided, Showcase chooses one at random.
+   * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+   * The name of the session. The ID must conform to ^[a-z]+$
+   * If this is not provided, Showcase chooses one at random.
+   * 
+ * + * string name = 1; + * @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 VERSION_FIELD_NUMBER = 2; + private int version_; + /** + *
+   * Required. The version this session is using.
+   * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override public int getVersionValue() { + return version_; + } + /** + *
+   * Required. The version this session is using.
+   * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return The version. + */ + @java.lang.Override public com.google.showcase.v1beta1.Session.Version getVersion() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Session.Version result = com.google.showcase.v1beta1.Session.Version.valueOf(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, version_); + } + 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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, version_); + } + 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.showcase.v1beta1.Session)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Session other = (com.google.showcase.v1beta1.Session) obj; + + if (!getName() + .equals(other.getName())) return false; + if (version_ != other.version_) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Session parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Session parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Session parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Session parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Session parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session 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 session is a suite of tests, generally being made in the context
+   * of testing code generation.
+   * A session defines tests it may expect, based on which version of the
+   * code generation spec is in use.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Session) + com.google.showcase.v1beta1.SessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, com.google.showcase.v1beta1.Session.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Session.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_ = ""; + + version_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Session.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session build() { + com.google.showcase.v1beta1.Session result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session buildPartial() { + com.google.showcase.v1beta1.Session result = new com.google.showcase.v1beta1.Session(this); + result.name_ = name_; + result.version_ = version_; + 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.showcase.v1beta1.Session) { + return mergeFrom((com.google.showcase.v1beta1.Session)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Session other) { + if (other == com.google.showcase.v1beta1.Session.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.version_ != 0) { + setVersionValue(other.getVersionValue()); + } + 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.showcase.v1beta1.Session parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Session) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the session. The ID must conform to ^[a-z]+$
+     * If this is not provided, Showcase chooses one at random.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The name of the session. The ID must conform to ^[a-z]+$
+     * If this is not provided, Showcase chooses one at random.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The name of the session. The ID must conform to ^[a-z]+$
+     * If this is not provided, Showcase chooses one at random.
+     * 
+ * + * string name = 1; + * @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; + } + /** + *
+     * The name of the session. The ID must conform to ^[a-z]+$
+     * If this is not provided, Showcase chooses one at random.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the session. The ID must conform to ^[a-z]+$
+     * If this is not provided, Showcase chooses one at random.
+     * 
+ * + * string name = 1; + * @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 int version_ = 0; + /** + *
+     * Required. The version this session is using.
+     * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override public int getVersionValue() { + return version_; + } + /** + *
+     * Required. The version this session is using.
+     * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @param value The enum numeric value on the wire for version to set. + * @return This builder for chaining. + */ + public Builder setVersionValue(int value) { + + version_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The version this session is using.
+     * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Session.Version result = com.google.showcase.v1beta1.Session.Version.valueOf(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.UNRECOGNIZED : result; + } + /** + *
+     * Required. The version this session is using.
+     * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(com.google.showcase.v1beta1.Session.Version value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Required. The version this session is using.
+     * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = 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.showcase.v1beta1.Session) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Session) + private static final com.google.showcase.v1beta1.Session DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Session(); + } + + public static com.google.showcase.v1beta1.Session getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Session parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Session(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.showcase.v1beta1.Session getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java new file mode 100644 index 0000000000..a205c1272d --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java @@ -0,0 +1,168 @@ +/* + * 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.showcase.v1beta1; + +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 SessionName implements ResourceName { + private static final PathTemplate SESSION = + PathTemplate.createWithoutUrlEncoding("sessions/{session}"); + private volatile Map fieldValuesMap; + private final String session; + + @Deprecated + protected SessionName() { + session = null; + } + + private SessionName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + } + + public String getSession() { + return session; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of(String session) { + return newBuilder().setSession(session).build(); + } + + public static String format(String session) { + return newBuilder().setSession(session).build().toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION.validatedMatch( + formattedString, "SessionName.parse: formattedString not in valid format"); + return of(matchMap.get("session")); + } + + 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 (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION.instantiate("session", session); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.session, that.session); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + return h; + } + + /** Builder for sessions/{session}. */ + public static class Builder { + private String session; + + protected Builder() {} + + public String getSession() { + return session; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + this.session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java new file mode 100644 index 0000000000..bf0021843a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java @@ -0,0 +1,50 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface SessionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Session) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the session. The ID must conform to ^[a-z]+$
+   * If this is not provided, Showcase chooses one at random.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The name of the session. The ID must conform to ^[a-z]+$
+   * If this is not provided, Showcase chooses one at random.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Required. The version this session is using.
+   * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return The enum numeric value on the wire for version. + */ + int getVersionValue(); + /** + *
+   * Required. The version this session is using.
+   * 
+ * + * .google.showcase.v1beta1.Session.Version version = 2; + * @return The version. + */ + com.google.showcase.v1beta1.Session.Version getVersion(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java new file mode 100644 index 0000000000..28d6564dcd --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java @@ -0,0 +1,135 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * A severity enum used to test enum capabilities in GAPIC surfaces.
+ * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.Severity} + */ +public enum Severity + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNNECESSARY = 0; + */ + UNNECESSARY(0), + /** + * NECESSARY = 1; + */ + NECESSARY(1), + /** + * URGENT = 2; + */ + URGENT(2), + /** + * CRITICAL = 3; + */ + CRITICAL(3), + UNRECOGNIZED(-1), + ; + + /** + * UNNECESSARY = 0; + */ + public static final int UNNECESSARY_VALUE = 0; + /** + * NECESSARY = 1; + */ + public static final int NECESSARY_VALUE = 1; + /** + * URGENT = 2; + */ + public static final int URGENT_VALUE = 2; + /** + * CRITICAL = 3; + */ + public static final int CRITICAL_VALUE = 3; + + + 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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: return UNNECESSARY; + case 1: return NECESSARY; + case 2: return URGENT; + case 3: return CRITICAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Severity> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.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.showcase.v1beta1.EchoOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Severity) +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java new file mode 100644 index 0000000000..204ec91396 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java @@ -0,0 +1,833 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ +public final class StreamBlurbsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsRequest) + StreamBlurbsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamBlurbsRequest.newBuilder() to construct. + private StreamBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamBlurbsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamBlurbsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamBlurbsRequest( + 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: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of a chat room or user profile whose blurbs to stream.
+   * 
+ * + * 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; + } + } + /** + *
+   * The resource name of a chat room or user profile whose blurbs to stream.
+   * 
+ * + * 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 EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + /** + *
+   * The time at which this stream will close.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + *
+   * The time at which this stream will close.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + *
+   * The time at which this stream will close.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + 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 (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + 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 (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getExpireTime()); + } + 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.showcase.v1beta1.StreamBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsRequest other = (com.google.showcase.v1beta1.StreamBlurbsRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime() + .equals(other.getExpireTime())) 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 (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.showcase.v1beta1.StreamBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsRequest.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_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest build() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = new com.google.showcase.v1beta1.StreamBlurbsRequest(this); + result.name_ = name_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + 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.showcase.v1beta1.StreamBlurbsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.StreamBlurbsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of a chat room or user profile whose blurbs to stream.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of a chat room or user profile whose blurbs to stream.
+     * 
+ * + * 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; + } + } + /** + *
+     * The resource name of a chat room or user profile whose blurbs to stream.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of a chat room or user profile whose blurbs to stream.
+     * 
+ * + * 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; + } + /** + *
+     * The resource name of a chat room or user profile whose blurbs to stream.
+     * 
+ * + * 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 com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> expireTimeBuilder_; + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setExpireTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + } + /** + *
+     * The time at which this stream will close.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), + getParentForChildren(), + isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + @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.showcase.v1beta1.StreamBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsRequest) + private static final com.google.showcase.v1beta1.StreamBlurbsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamBlurbsRequest(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.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..27fdb34a7a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface StreamBlurbsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of a chat room or user profile whose blurbs to stream.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of a chat room or user profile whose blurbs to stream.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The time at which this stream will close.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + *
+   * The time at which this stream will close.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + *
+   * The time at which this stream will close.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java new file mode 100644 index 0000000000..5d3d9a5208 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java @@ -0,0 +1,945 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ +public final class StreamBlurbsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsResponse) + StreamBlurbsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamBlurbsResponse.newBuilder() to construct. + private StreamBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamBlurbsResponse() { + action_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamBlurbsResponse( + 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.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (blurb_ != null) { + subBuilder = blurb_.toBuilder(); + } + blurb_ = input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(blurb_); + blurb_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + action_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + /** + *
+   * The action that triggered the blurb to be returned.
+   * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.StreamBlurbsResponse.Action} + */ + public enum Action + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACTION_UNSPECIFIED = 0; + */ + ACTION_UNSPECIFIED(0), + /** + *
+     * Specifies that the blurb was created.
+     * 
+ * + * CREATE = 1; + */ + CREATE(1), + /** + *
+     * Specifies that the blurb was updated.
+     * 
+ * + * UPDATE = 2; + */ + UPDATE(2), + /** + *
+     * Specifies that the blurb was deleted.
+     * 
+ * + * DELETE = 3; + */ + DELETE(3), + UNRECOGNIZED(-1), + ; + + /** + * ACTION_UNSPECIFIED = 0; + */ + public static final int ACTION_UNSPECIFIED_VALUE = 0; + /** + *
+     * Specifies that the blurb was created.
+     * 
+ * + * CREATE = 1; + */ + public static final int CREATE_VALUE = 1; + /** + *
+     * Specifies that the blurb was updated.
+     * 
+ * + * UPDATE = 2; + */ + public static final int UPDATE_VALUE = 2; + /** + *
+     * Specifies that the blurb was deleted.
+     * 
+ * + * DELETE = 3; + */ + public static final int DELETE_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Action valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Action forNumber(int value) { + switch (value) { + case 0: return ACTION_UNSPECIFIED; + case 1: return CREATE; + case 2: return UPDATE; + case 3: return DELETE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Action> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Action findValueByNumber(int number) { + return Action.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.showcase.v1beta1.StreamBlurbsResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final Action[] VALUES = values(); + + public static Action valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Action(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.StreamBlurbsResponse.Action) + } + + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + /** + *
+   * The blurb that was either created, updated, or deleted.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return blurb_ != null; + } + /** + *
+   * The blurb that was either created, updated, or deleted.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + /** + *
+   * The blurb that was either created, updated, or deleted.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return getBlurb(); + } + + public static final int ACTION_FIELD_NUMBER = 2; + private int action_; + /** + *
+   * The action that triggered the blurb to be returned.
+   * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + *
+   * The action that triggered the blurb to be returned.
+   * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return The action. + */ + @java.lang.Override public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = com.google.showcase.v1beta1.StreamBlurbsResponse.Action.valueOf(action_); + return result == null ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.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 (blurb_ != null) { + output.writeMessage(1, getBlurb()); + } + if (action_ != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, action_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blurb_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getBlurb()); + } + if (action_ != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, action_); + } + 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.showcase.v1beta1.StreamBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsResponse other = (com.google.showcase.v1beta1.StreamBlurbsResponse) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb() + .equals(other.getBlurb())) return false; + } + if (action_ != other.action_) 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 (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse 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; + } + /** + *
+   * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.showcase.v1beta1.StreamBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsResponse.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 (blurbBuilder_ == null) { + blurb_ = null; + } else { + blurb_ = null; + blurbBuilder_ = null; + } + action_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse build() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = new com.google.showcase.v1beta1.StreamBlurbsResponse(this); + if (blurbBuilder_ == null) { + result.blurb_ = blurb_; + } else { + result.blurb_ = blurbBuilder_.build(); + } + result.action_ = action_; + 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.showcase.v1beta1.StreamBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance()) return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + 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.showcase.v1beta1.StreamBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.StreamBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return blurbBuilder_ != null || blurb_ != null; + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb( + com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (blurb_ != null) { + blurb_ = + com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); + } else { + blurb_ = value; + } + onChanged(); + } else { + blurbBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + blurb_ = null; + onChanged(); + } else { + blurb_ = null; + blurbBuilder_ = null; + } + + return this; + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? + com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + /** + *
+     * The blurb that was either created, updated, or deleted.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), + getParentForChildren(), + isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private int action_ = 0; + /** + *
+     * The action that triggered the blurb to be returned.
+     * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + *
+     * The action that triggered the blurb to be returned.
+     * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + *
+     * The action that triggered the blurb to be returned.
+     * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = com.google.showcase.v1beta1.StreamBlurbsResponse.Action.valueOf(action_); + return result == null ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.UNRECOGNIZED : result; + } + /** + *
+     * The action that triggered the blurb to be returned.
+     * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.showcase.v1beta1.StreamBlurbsResponse.Action value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The action that triggered the blurb to be returned.
+     * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = 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.showcase.v1beta1.StreamBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsResponse) + private static final com.google.showcase.v1beta1.StreamBlurbsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamBlurbsResponse(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.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..d559b41956 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface StreamBlurbsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The blurb that was either created, updated, or deleted.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + /** + *
+   * The blurb that was either created, updated, or deleted.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + /** + *
+   * The blurb that was either created, updated, or deleted.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + *
+   * The action that triggered the blurb to be returned.
+   * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + /** + *
+   * The action that triggered the blurb to be returned.
+   * 
+ * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * @return The action. + */ + com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java new file mode 100644 index 0000000000..7199f69a27 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java @@ -0,0 +1,3839 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.Test} + */ +public final class Test extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test) + TestOrBuilder { +private static final long serialVersionUID = 0L; + // Use Test.newBuilder() to construct. + private Test(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Test() { + name_ = ""; + expectationLevel_ = 0; + description_ = ""; + blueprints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Test(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Test( + 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 16: { + int rawValue = input.readEnum(); + + expectationLevel_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + blueprints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + blueprints_.add( + input.readMessage(com.google.showcase.v1beta1.Test.Blueprint.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + blueprints_ = java.util.Collections.unmodifiableList(blueprints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); + } + + /** + *
+   * Whether or not a test is required, recommended, or optional.
+   * 
+ * + * Protobuf enum {@code google.showcase.v1beta1.Test.ExpectationLevel} + */ + public enum ExpectationLevel + implements com.google.protobuf.ProtocolMessageEnum { + /** + * EXPECTATION_LEVEL_UNSPECIFIED = 0; + */ + EXPECTATION_LEVEL_UNSPECIFIED(0), + /** + *
+     * This test is strictly required.
+     * 
+ * + * REQUIRED = 1; + */ + REQUIRED(1), + /** + *
+     * This test is recommended.
+     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
+     * then the report may still pass, but with a warning.
+     * If a generator skips a recommended test and does not explicitly
+     * express that intention, the report will fail.
+     * 
+ * + * RECOMMENDED = 2; + */ + RECOMMENDED(2), + /** + *
+     * This test is optional.
+     * If a generator explicitly ignores an optional test (see `DeleteTest`),
+     * then the report may still pass, and no warning will be issued.
+     * If a generator skips an optional test and does not explicitly
+     * express that intention, the report may still pass, but with a
+     * warning.
+     * 
+ * + * OPTIONAL = 3; + */ + OPTIONAL(3), + UNRECOGNIZED(-1), + ; + + /** + * EXPECTATION_LEVEL_UNSPECIFIED = 0; + */ + public static final int EXPECTATION_LEVEL_UNSPECIFIED_VALUE = 0; + /** + *
+     * This test is strictly required.
+     * 
+ * + * REQUIRED = 1; + */ + public static final int REQUIRED_VALUE = 1; + /** + *
+     * This test is recommended.
+     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
+     * then the report may still pass, but with a warning.
+     * If a generator skips a recommended test and does not explicitly
+     * express that intention, the report will fail.
+     * 
+ * + * RECOMMENDED = 2; + */ + public static final int RECOMMENDED_VALUE = 2; + /** + *
+     * This test is optional.
+     * If a generator explicitly ignores an optional test (see `DeleteTest`),
+     * then the report may still pass, and no warning will be issued.
+     * If a generator skips an optional test and does not explicitly
+     * express that intention, the report may still pass, but with a
+     * warning.
+     * 
+ * + * OPTIONAL = 3; + */ + public static final int OPTIONAL_VALUE = 3; + + + 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 ExpectationLevel 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 ExpectationLevel forNumber(int value) { + switch (value) { + case 0: return EXPECTATION_LEVEL_UNSPECIFIED; + case 1: return REQUIRED; + case 2: return RECOMMENDED; + case 3: return OPTIONAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ExpectationLevel> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExpectationLevel findValueByNumber(int number) { + return ExpectationLevel.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.showcase.v1beta1.Test.getDescriptor().getEnumTypes().get(0); + } + + private static final ExpectationLevel[] VALUES = values(); + + public static ExpectationLevel 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 ExpectationLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Test.ExpectationLevel) + } + + public interface BlueprintOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of this blueprint.
+     * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * The name of this blueprint.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * A description of this blueprint.
+     * 
+ * + * string description = 2; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+     * A description of this blueprint.
+     * 
+ * + * string description = 2; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+     * The initial request to trigger this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + *
+     * The initial request to trigger this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * @return The request. + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest(); + /** + *
+     * The initial request to trigger this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder(); + + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + java.util.List + getAdditionalRequestsList(); + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index); + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + int getAdditionalRequestsCount(); + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + java.util.List + getAdditionalRequestsOrBuilderList(); + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( + int index); + } + /** + *
+   * A blueprint is an explicit definition of methods and requests that are needed
+   * to be made to test this specific test case. Ideally this would be represented
+   * by something more robust like CEL, but as of writing this, I am unsure if CEL
+   * is ready.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Blueprint extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint) + BlueprintOrBuilder { + private static final long serialVersionUID = 0L; + // Use Blueprint.newBuilder() to construct. + private Blueprint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Blueprint() { + name_ = ""; + description_ = ""; + additionalRequests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Blueprint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Blueprint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + additionalRequests_.add( + input.readMessage(com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + public interface InvocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+       * The fully qualified name of the showcase method to be invoked.
+       * 
+ * + * string method = 1; + * @return The method. + */ + java.lang.String getMethod(); + /** + *
+       * The fully qualified name of the showcase method to be invoked.
+       * 
+ * + * string method = 1; + * @return The bytes for method. + */ + com.google.protobuf.ByteString + getMethodBytes(); + + /** + *
+       * The request to be made if a specific request is necessary.
+       * 
+ * + * bytes serialized_request = 2; + * @return The serializedRequest. + */ + com.google.protobuf.ByteString getSerializedRequest(); + } + /** + *
+     * A message representing a method invocation.
+     * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Invocation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + InvocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Invocation.newBuilder() to construct. + private Invocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Invocation() { + method_ = ""; + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Invocation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Invocation( + 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(); + + method_ = s; + break; + } + case 18: { + + serializedRequest_ = input.readBytes(); + 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.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + private volatile java.lang.Object method_; + /** + *
+       * The fully qualified name of the showcase method to be invoked.
+       * 
+ * + * string method = 1; + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + 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(); + method_ = s; + return s; + } + } + /** + *
+       * The fully qualified name of the showcase method to be invoked.
+       * 
+ * + * string method = 1; + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERIALIZED_REQUEST_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString serializedRequest_; + /** + *
+       * The request to be made if a specific request is necessary.
+       * 
+ * + * bytes serialized_request = 2; + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + 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(method_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (!serializedRequest_.isEmpty()) { + output.writeBytes(2, serializedRequest_); + } + 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(method_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (!serializedRequest_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, serializedRequest_); + } + 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.showcase.v1beta1.Test.Blueprint.Invocation)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint.Invocation other = (com.google.showcase.v1beta1.Test.Blueprint.Invocation) obj; + + if (!getMethod() + .equals(other.getMethod())) return false; + if (!getSerializedRequest() + .equals(other.getSerializedRequest())) 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) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + SERIALIZED_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getSerializedRequest().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation 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 message representing a method invocation.
+       * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.Invocation.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(); + method_ = ""; + + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation build() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(this); + result.method_ = method_; + result.serializedRequest_ = serializedRequest_; + 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.showcase.v1beta1.Test.Blueprint.Invocation) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint.Invocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint.Invocation other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + onChanged(); + } + if (other.getSerializedRequest() != com.google.protobuf.ByteString.EMPTY) { + setSerializedRequest(other.getSerializedRequest()); + } + 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.showcase.v1beta1.Test.Blueprint.Invocation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Test.Blueprint.Invocation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object method_ = ""; + /** + *
+         * The fully qualified name of the showcase method to be invoked.
+         * 
+ * + * string method = 1; + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+         * The fully qualified name of the showcase method to be invoked.
+         * 
+ * + * string method = 1; + * @return The bytes for method. + */ + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+         * The fully qualified name of the showcase method to be invoked.
+         * 
+ * + * string method = 1; + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + method_ = value; + onChanged(); + return this; + } + /** + *
+         * The fully qualified name of the showcase method to be invoked.
+         * 
+ * + * string method = 1; + * @return This builder for chaining. + */ + public Builder clearMethod() { + + method_ = getDefaultInstance().getMethod(); + onChanged(); + return this; + } + /** + *
+         * The fully qualified name of the showcase method to be invoked.
+         * 
+ * + * string method = 1; + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + method_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+         * The request to be made if a specific request is necessary.
+         * 
+ * + * bytes serialized_request = 2; + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + /** + *
+         * The request to be made if a specific request is necessary.
+         * 
+ * + * bytes serialized_request = 2; + * @param value The serializedRequest to set. + * @return This builder for chaining. + */ + public Builder setSerializedRequest(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + serializedRequest_ = value; + onChanged(); + return this; + } + /** + *
+         * The request to be made if a specific request is necessary.
+         * 
+ * + * bytes serialized_request = 2; + * @return This builder for chaining. + */ + public Builder clearSerializedRequest() { + + serializedRequest_ = getDefaultInstance().getSerializedRequest(); + 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.showcase.v1beta1.Test.Blueprint.Invocation) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint.Invocation) + private static final com.google.showcase.v1beta1.Test.Blueprint.Invocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Invocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Invocation(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.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+     * The name of this blueprint.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The name of this blueprint.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+     * A description of this blueprint.
+     * 
+ * + * string description = 2; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+     * A description of this blueprint.
+     * 
+ * + * string description = 2; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_FIELD_NUMBER = 3; + private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; + /** + *
+     * The initial request to trigger this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + *
+     * The initial request to trigger this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + return request_ == null ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() : request_; + } + /** + *
+     * The initial request to trigger this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int ADDITIONAL_REQUESTS_FIELD_NUMBER = 4; + private java.util.List additionalRequests_; + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + @java.lang.Override + public java.util.List getAdditionalRequestsList() { + return additionalRequests_; + } + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsOrBuilderList() { + return additionalRequests_; + } + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + @java.lang.Override + public int getAdditionalRequestsCount() { + return additionalRequests_.size(); + } + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { + return additionalRequests_.get(index); + } + /** + *
+     * An ordered list of method calls that can be called to trigger this test.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( + int index) { + return additionalRequests_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (request_ != null) { + output.writeMessage(3, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + output.writeMessage(4, additionalRequests_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, additionalRequests_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Test.Blueprint)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint other = (com.google.showcase.v1beta1.Test.Blueprint) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (!getAdditionalRequestsList() + .equals(other.getAdditionalRequestsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + if (getAdditionalRequestsCount() > 0) { + hash = (37 * hash) + ADDITIONAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalRequestsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint 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 blueprint is an explicit definition of methods and requests that are needed
+     * to be made to test this specific test case. Ideally this would be represented
+     * by something more robust like CEL, but as of writing this, I am unsure if CEL
+     * is ready.
+     * 
+ * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint) + com.google.showcase.v1beta1.Test.BlueprintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAdditionalRequestsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + additionalRequestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint build() { + com.google.showcase.v1beta1.Test.Blueprint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint result = new com.google.showcase.v1beta1.Test.Blueprint(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + if (additionalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.additionalRequests_ = additionalRequests_; + } else { + result.additionalRequests_ = additionalRequestsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test.Blueprint) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (additionalRequestsBuilder_ == null) { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequests_.isEmpty()) { + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.addAll(other.additionalRequests_); + } + onChanged(); + } + } else { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequestsBuilder_.isEmpty()) { + additionalRequestsBuilder_.dispose(); + additionalRequestsBuilder_ = null; + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + additionalRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAdditionalRequestsFieldBuilder() : null; + } else { + additionalRequestsBuilder_.addAllMessages(other.additionalRequests_); + } + } + } + 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.showcase.v1beta1.Test.Blueprint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Test.Blueprint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+       * The name of this blueprint.
+       * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+       * The name of this blueprint.
+       * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+       * The name of this blueprint.
+       * 
+ * + * string name = 1; + * @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; + } + /** + *
+       * The name of this blueprint.
+       * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * The name of this blueprint.
+       * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * A description of this blueprint.
+       * 
+ * + * string description = 2; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A description of this blueprint.
+       * 
+ * + * string description = 2; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A description of this blueprint.
+       * 
+ * + * string description = 2; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * A description of this blueprint.
+       * 
+ * + * string description = 2; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * A description of this blueprint.
+       * 
+ * + * string description = 2; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> requestBuilder_; + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * @return The request. + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() : request_; + } + } + /** + *
+       * The initial request to trigger this test.
+       * 
+ * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.util.List additionalRequests_ = + java.util.Collections.emptyList(); + private void ensureAdditionalRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = new java.util.ArrayList(additionalRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> additionalRequestsBuilder_; + + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public java.util.List getAdditionalRequestsList() { + if (additionalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalRequests_); + } else { + return additionalRequestsBuilder_.getMessageList(); + } + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public int getAdditionalRequestsCount() { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.size(); + } else { + return additionalRequestsBuilder_.getCount(); + } + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessage(index); + } + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder setAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder setAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder addAdditionalRequests(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder addAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder addAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder addAllAdditionalRequests( + java.lang.Iterable values) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalRequests_); + onChanged(); + } else { + additionalRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder clearAdditionalRequests() { + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + additionalRequestsBuilder_.clear(); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public Builder removeAdditionalRequests(int index) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.remove(index); + onChanged(); + } else { + additionalRequestsBuilder_.remove(index); + } + return this; + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getAdditionalRequestsBuilder( + int index) { + return getAdditionalRequestsFieldBuilder().getBuilder(index); + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( + int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); } else { + return additionalRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public java.util.List + getAdditionalRequestsOrBuilderList() { + if (additionalRequestsBuilder_ != null) { + return additionalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalRequests_); + } + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder addAdditionalRequestsBuilder() { + return getAdditionalRequestsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder addAdditionalRequestsBuilder( + int index) { + return getAdditionalRequestsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + /** + *
+       * An ordered list of method calls that can be called to trigger this test.
+       * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + */ + public java.util.List + getAdditionalRequestsBuilderList() { + return getAdditionalRequestsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getAdditionalRequestsFieldBuilder() { + if (additionalRequestsBuilder_ == null) { + additionalRequestsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + additionalRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + additionalRequests_ = null; + } + return additionalRequestsBuilder_; + } + @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.showcase.v1beta1.Test.Blueprint) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint) + private static final com.google.showcase.v1beta1.Test.Blueprint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blueprint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Blueprint(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.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string name = 1; + * @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 EXPECTATION_LEVEL_FIELD_NUMBER = 2; + private int expectationLevel_; + /** + *
+   * The expectation level for this test.
+   * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override public int getExpectationLevelValue() { + return expectationLevel_; + } + /** + *
+   * The expectation level for this test.
+   * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return The expectationLevel. + */ + @java.lang.Override public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Test.ExpectationLevel result = com.google.showcase.v1beta1.Test.ExpectationLevel.valueOf(expectationLevel_); + return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+   * A description of the test.
+   * 
+ * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * A description of the test.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BLUEPRINTS_FIELD_NUMBER = 4; + private java.util.List blueprints_; + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List getBlueprintsList() { + return blueprints_; + } + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List + getBlueprintsOrBuilderList() { + return blueprints_; + } + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public int getBlueprintsCount() { + return blueprints_.size(); + } + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + return blueprints_.get(index); + } + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder( + int index) { + return blueprints_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (expectationLevel_ != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED.getNumber()) { + output.writeEnum(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + output.writeMessage(4, blueprints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (expectationLevel_ != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, blueprints_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Test)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test other = (com.google.showcase.v1beta1.Test) obj; + + if (!getName() + .equals(other.getName())) return false; + if (expectationLevel_ != other.expectationLevel_) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getBlueprintsList() + .equals(other.getBlueprintsList())) 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) + EXPECTATION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + expectationLevel_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getBlueprintsCount() > 0) { + hash = (37 * hash) + BLUEPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getBlueprintsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Test parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.Test parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.Test parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.Test} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test) + com.google.showcase.v1beta1.TestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getBlueprintsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + expectationLevel_ = 0; + + description_ = ""; + + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + blueprintsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test build() { + com.google.showcase.v1beta1.Test result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test buildPartial() { + com.google.showcase.v1beta1.Test result = new com.google.showcase.v1beta1.Test(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.expectationLevel_ = expectationLevel_; + result.description_ = description_; + if (blueprintsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blueprints_ = java.util.Collections.unmodifiableList(blueprints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blueprints_ = blueprints_; + } else { + result.blueprints_ = blueprintsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test) { + return mergeFrom((com.google.showcase.v1beta1.Test)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test other) { + if (other == com.google.showcase.v1beta1.Test.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.expectationLevel_ != 0) { + setExpectationLevelValue(other.getExpectationLevelValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (blueprintsBuilder_ == null) { + if (!other.blueprints_.isEmpty()) { + if (blueprints_.isEmpty()) { + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlueprintsIsMutable(); + blueprints_.addAll(other.blueprints_); + } + onChanged(); + } + } else { + if (!other.blueprints_.isEmpty()) { + if (blueprintsBuilder_.isEmpty()) { + blueprintsBuilder_.dispose(); + blueprintsBuilder_ = null; + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000001); + blueprintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBlueprintsFieldBuilder() : null; + } else { + blueprintsBuilder_.addAllMessages(other.blueprints_); + } + } + } + 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.showcase.v1beta1.Test parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Test) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string name = 1; + * @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; + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string name = 1; + * @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 int expectationLevel_ = 0; + /** + *
+     * The expectation level for this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override public int getExpectationLevelValue() { + return expectationLevel_; + } + /** + *
+     * The expectation level for this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @param value The enum numeric value on the wire for expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevelValue(int value) { + + expectationLevel_ = value; + onChanged(); + return this; + } + /** + *
+     * The expectation level for this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Test.ExpectationLevel result = com.google.showcase.v1beta1.Test.ExpectationLevel.valueOf(expectationLevel_); + return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; + } + /** + *
+     * The expectation level for this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @param value The expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevel(com.google.showcase.v1beta1.Test.ExpectationLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + expectationLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The expectation level for this test.
+     * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return This builder for chaining. + */ + public Builder clearExpectationLevel() { + + expectationLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * A description of the test.
+     * 
+ * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A description of the test.
+     * 
+ * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A description of the test.
+     * 
+ * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * A description of the test.
+     * 
+ * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * A description of the test.
+     * 
+ * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.util.List blueprints_ = + java.util.Collections.emptyList(); + private void ensureBlueprintsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blueprints_ = new java.util.ArrayList(blueprints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, com.google.showcase.v1beta1.Test.Blueprint.Builder, com.google.showcase.v1beta1.Test.BlueprintOrBuilder> blueprintsBuilder_; + + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List getBlueprintsList() { + if (blueprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blueprints_); + } else { + return blueprintsBuilder_.getMessageList(); + } + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public int getBlueprintsCount() { + if (blueprintsBuilder_ == null) { + return blueprints_.size(); + } else { + return blueprintsBuilder_.getCount(); + } + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessage(index); + } + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.set(index, value); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.set(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(index, value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addAllBlueprints( + java.lang.Iterable values) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, blueprints_); + onChanged(); + } else { + blueprintsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder clearBlueprints() { + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blueprintsBuilder_.clear(); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder removeBlueprints(int index) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.remove(index); + onChanged(); + } else { + blueprintsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder getBlueprintsBuilder( + int index) { + return getBlueprintsFieldBuilder().getBuilder(index); + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder( + int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); } else { + return blueprintsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsOrBuilderList() { + if (blueprintsBuilder_ != null) { + return blueprintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blueprints_); + } + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder() { + return getBlueprintsFieldBuilder().addBuilder( + com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder( + int index) { + return getBlueprintsFieldBuilder().addBuilder( + index, com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + /** + *
+     * The blueprints that will satisfy this test. There may be multiple blueprints
+     * that can signal to the server that this test case is being exercised. Although
+     * multiple blueprints are specified, only a single blueprint needs to be run to
+     * signal that the test case was exercised.
+     * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsBuilderList() { + return getBlueprintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, com.google.showcase.v1beta1.Test.Blueprint.Builder, com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + getBlueprintsFieldBuilder() { + if (blueprintsBuilder_ == null) { + blueprintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, com.google.showcase.v1beta1.Test.Blueprint.Builder, com.google.showcase.v1beta1.Test.BlueprintOrBuilder>( + blueprints_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + blueprints_ = null; + } + return blueprintsBuilder_; + } + @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.showcase.v1beta1.Test) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test) + private static final com.google.showcase.v1beta1.Test DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test(); + } + + public static com.google.showcase.v1beta1.Test getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Test parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Test(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.showcase.v1beta1.Test getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java new file mode 100644 index 0000000000..fb2855113a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java @@ -0,0 +1,191 @@ +/* + * 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.showcase.v1beta1; + +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 TestName implements ResourceName { + private static final PathTemplate SESSION_TEST = + PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); + private volatile Map fieldValuesMap; + private final String session; + private final String test; + + @Deprecated + protected TestName() { + session = null; + test = null; + } + + private TestName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + test = Preconditions.checkNotNull(builder.getTest()); + } + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TestName of(String session, String test) { + return newBuilder().setSession(session).setTest(test).build(); + } + + public static String format(String session, String test) { + return newBuilder().setSession(session).setTest(test).build().toString(); + } + + public static TestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION_TEST.validatedMatch( + formattedString, "TestName.parse: formattedString not in valid format"); + return of(matchMap.get("session"), matchMap.get("test")); + } + + 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 (TestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION_TEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (test != null) { + fieldMapBuilder.put("test", test); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION_TEST.instantiate("session", session, "test", test); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TestName that = ((TestName) o); + return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(test); + return h; + } + + /** Builder for sessions/{session}/tests/{test}. */ + public static class Builder { + private String session; + private String test; + + protected Builder() {} + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + public Builder setTest(String test) { + this.test = test; + return this; + } + + private Builder(TestName testName) { + this.session = testName.session; + this.test = testName.test; + } + + public TestName build() { + return new TestName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java new file mode 100644 index 0000000000..54a88bc62a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface TestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The expectation level for this test.
+   * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return The enum numeric value on the wire for expectationLevel. + */ + int getExpectationLevelValue(); + /** + *
+   * The expectation level for this test.
+   * 
+ * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * @return The expectationLevel. + */ + com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel(); + + /** + *
+   * A description of the test.
+   * 
+ * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * A description of the test.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List + getBlueprintsList(); + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index); + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + int getBlueprintsCount(); + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List + getBlueprintsOrBuilderList(); + /** + *
+   * The blueprints that will satisfy this test. There may be multiple blueprints
+   * that can signal to the server that this test case is being exercised. Although
+   * multiple blueprints are specified, only a single blueprint needs to be run to
+   * signal that the test case was exercised.
+   * 
+ * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder( + int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java new file mode 100644 index 0000000000..f83126f72c --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java @@ -0,0 +1,845 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * A TestRun is the result of running a Test.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ +public final class TestRun extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.TestRun) + TestRunOrBuilder { +private static final long serialVersionUID = 0L; + // Use TestRun.newBuilder() to construct. + private TestRun(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TestRun() { + test_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TestRun(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TestRun( + 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(); + + test_ = s; + break; + } + case 18: { + com.google.showcase.v1beta1.Issue.Builder subBuilder = null; + if (issue_ != null) { + subBuilder = issue_.toBuilder(); + } + issue_ = input.readMessage(com.google.showcase.v1beta1.Issue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(issue_); + issue_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, com.google.showcase.v1beta1.TestRun.Builder.class); + } + + public static final int TEST_FIELD_NUMBER = 1; + private volatile java.lang.Object test_; + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return The test. + */ + @java.lang.Override + public java.lang.String getTest() { + java.lang.Object ref = test_; + 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(); + test_ = s; + return s; + } + } + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for test. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISSUE_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Issue issue_; + /** + *
+   * An issue found with the test run. If empty, this test run was successful.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return issue_ != null; + } + /** + *
+   * An issue found with the test run. If empty, this test run was successful.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + /** + *
+   * An issue found with the test run. If empty, this test run was successful.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return getIssue(); + } + + 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(test_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, test_); + } + if (issue_ != null) { + output.writeMessage(2, getIssue()); + } + 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(test_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, test_); + } + if (issue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getIssue()); + } + 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.showcase.v1beta1.TestRun)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.TestRun other = (com.google.showcase.v1beta1.TestRun) obj; + + if (!getTest() + .equals(other.getTest())) return false; + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue() + .equals(other.getIssue())) 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) + TEST_FIELD_NUMBER; + hash = (53 * hash) + getTest().hashCode(); + if (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.TestRun parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.TestRun parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.TestRun parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.TestRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun 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 TestRun is the result of running a Test.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.TestRun) + com.google.showcase.v1beta1.TestRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, com.google.showcase.v1beta1.TestRun.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.TestRun.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(); + test_ = ""; + + if (issueBuilder_ == null) { + issue_ = null; + } else { + issue_ = null; + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return com.google.showcase.v1beta1.TestRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun build() { + com.google.showcase.v1beta1.TestRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun buildPartial() { + com.google.showcase.v1beta1.TestRun result = new com.google.showcase.v1beta1.TestRun(this); + result.test_ = test_; + if (issueBuilder_ == null) { + result.issue_ = issue_; + } else { + result.issue_ = issueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.TestRun) { + return mergeFrom((com.google.showcase.v1beta1.TestRun)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.TestRun other) { + if (other == com.google.showcase.v1beta1.TestRun.getDefaultInstance()) return this; + if (!other.getTest().isEmpty()) { + test_ = other.test_; + onChanged(); + } + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + 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.showcase.v1beta1.TestRun parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.TestRun) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object test_ = ""; + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return The test. + */ + public java.lang.String getTest() { + java.lang.Object ref = test_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + test_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for test. + */ + public com.google.protobuf.ByteString + getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @param value The test to set. + * @return This builder for chaining. + */ + public Builder setTest( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + test_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearTest() { + + test_ = getDefaultInstance().getTest(); + onChanged(); + return this; + } + /** + *
+     * The name of the test.
+     * The tests/* portion of the names are hard-coded, and do not change
+     * from session to session.
+     * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @param value The bytes for test to set. + * @return This builder for chaining. + */ + public Builder setTestBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + test_ = value; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> issueBuilder_; + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return issueBuilder_ != null || issue_ != null; + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + onChanged(); + } else { + issueBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue( + com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + onChanged(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (issue_ != null) { + issue_ = + com.google.showcase.v1beta1.Issue.newBuilder(issue_).mergeFrom(value).buildPartial(); + } else { + issue_ = value; + } + onChanged(); + } else { + issueBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder clearIssue() { + if (issueBuilder_ == null) { + issue_ = null; + onChanged(); + } else { + issue_ = null; + issueBuilder_ = null; + } + + return this; + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + + onChanged(); + return getIssueFieldBuilder().getBuilder(); + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? + com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + /** + *
+     * An issue found with the test run. If empty, this test run was successful.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), + getParentForChildren(), + isClean()); + issue_ = null; + } + return issueBuilder_; + } + @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.showcase.v1beta1.TestRun) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.TestRun) + private static final com.google.showcase.v1beta1.TestRun DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.TestRun(); + } + + public static com.google.showcase.v1beta1.TestRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TestRun parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TestRun(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.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java new file mode 100644 index 0000000000..e562eb82fc --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface TestRunOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.TestRun) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return The test. + */ + java.lang.String getTest(); + /** + *
+   * The name of the test.
+   * The tests/* portion of the names are hard-coded, and do not change
+   * from session to session.
+   * 
+ * + * string test = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for test. + */ + com.google.protobuf.ByteString + getTestBytes(); + + /** + *
+   * An issue found with the test run. If empty, this test run was successful.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + * @return Whether the issue field is set. + */ + boolean hasIssue(); + /** + *
+   * An issue found with the test run. If empty, this test run was successful.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + /** + *
+   * An issue found with the test run. If empty, this test run was successful.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 2; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java new file mode 100644 index 0000000000..1dde804ac5 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java @@ -0,0 +1,345 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public final class TestingOuterClass { + private TestingOuterClass() {} + 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_showcase_v1beta1_Session_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Issue_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_TestRun_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n,schema/google/showcase/v1beta1/testing" + + ".proto\022\027google.showcase.v1beta1\032\034google/" + + "api/annotations.proto\032\027google/api/client" + + ".proto\032\031google/api/resource.proto\032\033googl" + + "e/protobuf/empty.proto\"\311\001\n\007Session\022\014\n\004na" + + "me\030\001 \001(\t\0229\n\007version\030\002 \001(\0162(.google.showc" + + "ase.v1beta1.Session.Version\";\n\007Version\022\027" + + "\n\023VERSION_UNSPECIFIED\020\000\022\r\n\tV1_LATEST\020\001\022\010" + + "\n\004V1_0\020\002:8\352A5\n\037showcase.googleapis.com/S" + + "ession\022\022sessions/{session}\"I\n\024CreateSess" + + "ionRequest\0221\n\007session\030\001 \001(\0132 .google.sho" + + "wcase.v1beta1.Session\"G\n\021GetSessionReque" + + "st\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleap" + + "is.com/Session\"<\n\023ListSessionsRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t\"c\n\024" + + "ListSessionsResponse\0222\n\010sessions\030\001 \003(\0132 " + + ".google.showcase.v1beta1.Session\022\027\n\017next" + + "_page_token\030\002 \001(\t\"J\n\024DeleteSessionReques" + + "t\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapi" + + "s.com/Session\"J\n\024ReportSessionRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapis.co" + + "m/Session\"\335\001\n\025ReportSessionResponse\022E\n\006r" + + "esult\030\001 \001(\01625.google.showcase.v1beta1.Re" + + "portSessionResponse.Result\0223\n\ttest_runs\030" + + "\002 \003(\0132 .google.showcase.v1beta1.TestRun\"" + + "H\n\006Result\022\026\n\022RESULT_UNSPECIFIED\020\000\022\n\n\006PAS" + + "SED\020\001\022\n\n\006FAILED\020\002\022\016\n\nINCOMPLETE\020\003\"\272\005\n\004Te" + + "st\022\014\n\004name\030\001 \001(\t\022I\n\021expectation_level\030\002 " + + "\001(\0162..google.showcase.v1beta1.Test.Expec" + + "tationLevel\022\023\n\013description\030\003 \001(\t\022;\n\nblue" + + "prints\030\004 \003(\0132\'.google.showcase.v1beta1.T" + + "est.Blueprint\032\336\002\n\tBlueprint\022\014\n\004name\030\001 \001(" + + "\t\022\023\n\013description\030\002 \001(\t\022C\n\007request\030\003 \001(\0132" + + "2.google.showcase.v1beta1.Test.Blueprint" + + ".Invocation\022O\n\023additional_requests\030\004 \003(\013" + + "22.google.showcase.v1beta1.Test.Blueprin" + + "t.Invocation\0328\n\nInvocation\022\016\n\006method\030\001 \001" + + "(\t\022\032\n\022serialized_request\030\002 \001(\014:^\352A[\n!sho" + + "wcase.googleapis.com/Blueprint\0226sessions" + + "/{session}/tests/{test}/blueprints/{blue" + + "print}\"b\n\020ExpectationLevel\022!\n\035EXPECTATIO" + + "N_LEVEL_UNSPECIFIED\020\000\022\014\n\010REQUIRED\020\001\022\017\n\013R" + + "ECOMMENDED\020\002\022\014\n\010OPTIONAL\020\003:B\352A?\n\034showcas" + + "e.googleapis.com/Test\022\037sessions/{session" + + "}/tests/{test}\"\234\002\n\005Issue\0221\n\004type\030\001 \001(\0162#" + + ".google.showcase.v1beta1.Issue.Type\0229\n\010s" + + "everity\030\002 \001(\0162\'.google.showcase.v1beta1." + + "Issue.Severity\022\023\n\013description\030\003 \001(\t\"R\n\004T" + + "ype\022\024\n\020TYPE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\013" + + "\n\007PENDING\020\002\022\032\n\026INCORRECT_CONFIRMATION\020\003\"" + + "<\n\010Severity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022\t\n" + + "\005ERROR\020\001\022\013\n\007WARNING\020\002\"o\n\020ListTestsReques" + + "t\0224\n\006parent\030\001 \001(\tB$\372A!\n\037showcase.googlea" + + "pis.com/Session\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\"Z\n\021ListTestsResponse\022,\n\005t" + + "ests\030\001 \003(\0132\035.google.showcase.v1beta1.Tes" + + "t\022\027\n\017next_page_token\030\002 \001(\t\"i\n\007TestRun\022/\n" + + "\004test\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.co" + + "m/Test\022-\n\005issue\030\002 \001(\0132\036.google.showcase." + + "v1beta1.Issue\"D\n\021DeleteTestRequest\022/\n\004na" + + "me\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.com/T" + + "est\"e\n\021VerifyTestRequest\022/\n\004name\030\001 \001(\tB!" + + "\372A\036\n\034showcase.googleapis.com/Test\022\016\n\006ans" + + "wer\030\002 \001(\014\022\017\n\007answers\030\003 \003(\014\"C\n\022VerifyTest" + + "Response\022-\n\005issue\030\001 \001(\0132\036.google.showcas" + + "e.v1beta1.Issue2\355\010\n\007Testing\022\204\001\n\rCreateSe" + + "ssion\022-.google.showcase.v1beta1.CreateSe" + + "ssionRequest\032 .google.showcase.v1beta1.S" + + "ession\"\"\202\323\344\223\002\034\"\021/v1beta1/sessions:\007sessi" + + "on\022~\n\nGetSession\022*.google.showcase.v1bet" + + "a1.GetSessionRequest\032 .google.showcase.v" + + "1beta1.Session\"\"\202\323\344\223\002\034\022\032/v1beta1/{name=s" + + "essions/*}\022\206\001\n\014ListSessions\022,.google.sho" + + "wcase.v1beta1.ListSessionsRequest\032-.goog" + + "le.showcase.v1beta1.ListSessionsResponse" + + "\"\031\202\323\344\223\002\023\022\021/v1beta1/sessions\022z\n\rDeleteSes" + + "sion\022-.google.showcase.v1beta1.DeleteSes" + + "sionRequest\032\026.google.protobuf.Empty\"\"\202\323\344" + + "\223\002\034*\032/v1beta1/{name=sessions/*}\022\231\001\n\rRepo" + + "rtSession\022-.google.showcase.v1beta1.Repo" + + "rtSessionRequest\032..google.showcase.v1bet" + + "a1.ReportSessionResponse\")\202\323\344\223\002#\"!/v1bet" + + "a1/{name=sessions/*}:report\022\216\001\n\tListTest" + + "s\022).google.showcase.v1beta1.ListTestsReq" + + "uest\032*.google.showcase.v1beta1.ListTests" + + "Response\"*\202\323\344\223\002$\022\"/v1beta1/{parent=sessi" + + "ons/*}/tests\022|\n\nDeleteTest\022*.google.show" + + "case.v1beta1.DeleteTestRequest\032\026.google." + + "protobuf.Empty\"*\202\323\344\223\002$*\"/v1beta1/{name=s" + + "essions/*/tests/*}\022\227\001\n\nVerifyTest\022*.goog" + + "le.showcase.v1beta1.VerifyTestRequest\032+." + + "google.showcase.v1beta1.VerifyTestRespon" + + "se\"0\202\323\344\223\002*\"(/v1beta1/{name=sessions/*/te" + + "sts/*}:check\032\021\312A\016localhost:7469Bq\n\033com.g" + + "oogle.showcase.v1beta1P\001Z4github.com/goo" + + "gleapis/gapic-showcase/server/genproto\352\002" + + "\031Google::Showcase::V1beta1b\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.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Session_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Session_descriptor, + new java.lang.String[] { "Name", "Version", }); + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor, + new java.lang.String[] { "Session", }); + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor, + new java.lang.String[] { "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor, + new java.lang.String[] { "Sessions", "NextPageToken", }); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor, + new java.lang.String[] { "Result", "TestRuns", }); + internal_static_google_showcase_v1beta1_Test_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_descriptor, + new java.lang.String[] { "Name", "ExpectationLevel", "Description", "Blueprints", }); + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor = + internal_static_google_showcase_v1beta1_Test_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor, + new java.lang.String[] { "Name", "Description", "Request", "AdditionalRequests", }); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor = + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor, + new java.lang.String[] { "Method", "SerializedRequest", }); + internal_static_google_showcase_v1beta1_Issue_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Issue_descriptor, + new java.lang.String[] { "Type", "Severity", "Description", }); + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor, + new java.lang.String[] { "Tests", "NextPageToken", }); + internal_static_google_showcase_v1beta1_TestRun_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_TestRun_descriptor, + new java.lang.String[] { "Test", "Issue", }); + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor, + new java.lang.String[] { "Name", "Answer", "Answers", }); + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor, + new java.lang.String[] { "Issue", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java new file mode 100644 index 0000000000..3a0e37969d --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java @@ -0,0 +1,915 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ +public final class UpdateBlurbRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateBlurbRequest) + UpdateBlurbRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateBlurbRequest.newBuilder() to construct. + private UpdateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateBlurbRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdateBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateBlurbRequest( + 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.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (blurb_ != null) { + subBuilder = blurb_.toBuilder(); + } + blurb_ = input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(blurb_); + blurb_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + /** + *
+   * The blurb to update.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return blurb_ != null; + } + /** + *
+   * The blurb to update.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + /** + *
+   * The blurb to update.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return getBlurb(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The field mask to determine wich fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The field mask to determine wich fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The field mask to determine wich fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (blurb_ != null) { + output.writeMessage(1, getBlurb()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blurb_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getBlurb()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + 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.showcase.v1beta1.UpdateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateBlurbRequest other = (com.google.showcase.v1beta1.UpdateBlurbRequest) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb() + .equals(other.getBlurb())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) 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 (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.showcase.v1beta1.UpdateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateBlurbRequest.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 (blurbBuilder_ == null) { + blurb_ = null; + } else { + blurb_ = null; + blurbBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest build() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = new com.google.showcase.v1beta1.UpdateBlurbRequest(this); + if (blurbBuilder_ == null) { + result.blurb_ = blurb_; + } else { + result.blurb_ = blurbBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateBlurbRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance()) return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.showcase.v1beta1.UpdateBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.UpdateBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return blurbBuilder_ != null || blurb_ != null; + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb( + com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (blurb_ != null) { + blurb_ = + com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); + } else { + blurb_ = value; + } + onChanged(); + } else { + blurbBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + blurb_ = null; + onChanged(); + } else { + blurb_ = null; + blurbBuilder_ = null; + } + + return this; + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? + com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + /** + *
+     * The blurb to update.
+     * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), + getParentForChildren(), + isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The field mask to determine wich fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @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.showcase.v1beta1.UpdateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateBlurbRequest) + private static final com.google.showcase.v1beta1.UpdateBlurbRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBlurbRequest(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.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..73cd144983 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface UpdateBlurbRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The blurb to update.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + /** + *
+   * The blurb to update.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + /** + *
+   * The blurb to update.
+   * 
+ * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + *
+   * The field mask to determine wich fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The field mask to determine wich fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The field mask to determine wich fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java new file mode 100644 index 0000000000..d3defe92cd --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java @@ -0,0 +1,915 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ +public final class UpdateRoomRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateRoomRequest) + UpdateRoomRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateRoomRequest.newBuilder() to construct. + private UpdateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateRoomRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdateRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateRoomRequest( + 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.showcase.v1beta1.Room.Builder subBuilder = null; + if (room_ != null) { + subBuilder = room_.toBuilder(); + } + room_ = input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(room_); + room_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + 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.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + /** + *
+   * The room to update.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return room_ != null; + } + /** + *
+   * The room to update.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + /** + *
+   * The room to update.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return getRoom(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (room_ != null) { + output.writeMessage(1, getRoom()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (room_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRoom()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + 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.showcase.v1beta1.UpdateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateRoomRequest other = (com.google.showcase.v1beta1.UpdateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom() + .equals(other.getRoom())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) 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 (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateRoomRequest) + com.google.showcase.v1beta1.UpdateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateRoomRequest.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 (roomBuilder_ == null) { + room_ = null; + } else { + room_ = null; + roomBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest build() { + com.google.showcase.v1beta1.UpdateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest buildPartial() { + com.google.showcase.v1beta1.UpdateRoomRequest result = new com.google.showcase.v1beta1.UpdateRoomRequest(this); + if (roomBuilder_ == null) { + result.room_ = room_; + } else { + result.room_ = roomBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateRoomRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateRoomRequest other) { + if (other == com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.showcase.v1beta1.UpdateRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.UpdateRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> roomBuilder_; + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return roomBuilder_ != null || room_ != null; + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + onChanged(); + } else { + roomBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom( + com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + onChanged(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (room_ != null) { + room_ = + com.google.showcase.v1beta1.Room.newBuilder(room_).mergeFrom(value).buildPartial(); + } else { + room_ = value; + } + onChanged(); + } else { + roomBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + if (roomBuilder_ == null) { + room_ = null; + onChanged(); + } else { + room_ = null; + roomBuilder_ = null; + } + + return this; + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + + onChanged(); + return getRoomFieldBuilder().getBuilder(); + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? + com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + /** + *
+     * The room to update.
+     * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> + getRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), + getParentForChildren(), + isClean()); + room_ = null; + } + return roomBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @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.showcase.v1beta1.UpdateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateRoomRequest) + private static final com.google.showcase.v1beta1.UpdateRoomRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateRoomRequest(); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateRoomRequest(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.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..fdd96ea574 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface UpdateRoomRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The room to update.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return Whether the room field is set. + */ + boolean hasRoom(); + /** + *
+   * The room to update.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + /** + *
+   * The room to update.
+   * 
+ * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); + + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java new file mode 100644 index 0000000000..68d8b179a1 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java @@ -0,0 +1,915 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request message for the google.showcase.v1beta1.Identity\UpdateUser
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ +public final class UpdateUserRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateUserRequest) + UpdateUserRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateUserRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdateUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateUserRequest( + 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.showcase.v1beta1.User.Builder subBuilder = null; + if (user_ != null) { + subBuilder = user_.toBuilder(); + } + user_ = input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(user_); + user_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + 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.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + /** + *
+   * The user to update.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + *
+   * The user to update.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + /** + *
+   * The user to update.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return getUser(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (user_ != null) { + output.writeMessage(1, getUser()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUser()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + 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.showcase.v1beta1.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateUserRequest other = (com.google.showcase.v1beta1.UpdateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) 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 (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest 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; + } + /** + *
+   * The request message for the google.showcase.v1beta1.Identity\UpdateUser
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateUserRequest) + com.google.showcase.v1beta1.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateUserRequest.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 (userBuilder_ == null) { + user_ = null; + } else { + user_ = null; + userBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest build() { + com.google.showcase.v1beta1.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest buildPartial() { + com.google.showcase.v1beta1.UpdateUserRequest result = new com.google.showcase.v1beta1.UpdateUserRequest(this); + if (userBuilder_ == null) { + result.user_ = user_; + } else { + result.user_ = userBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateUserRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateUserRequest other) { + if (other == com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.showcase.v1beta1.UpdateUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.UpdateUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> userBuilder_; + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return userBuilder_ != null || user_ != null; + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + onChanged(); + } else { + userBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser( + com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + onChanged(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (user_ != null) { + user_ = + com.google.showcase.v1beta1.User.newBuilder(user_).mergeFrom(value).buildPartial(); + } else { + user_ = value; + } + onChanged(); + } else { + userBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + if (userBuilder_ == null) { + user_ = null; + onChanged(); + } else { + user_ = null; + userBuilder_ = null; + } + + return this; + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + /** + *
+     * The user to update.
+     * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The field mask to determine which fields are to be updated. If empty, the
+     * server will assume all fields are to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @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.showcase.v1beta1.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateUserRequest) + private static final com.google.showcase.v1beta1.UpdateUserRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateUserRequest(); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateUserRequest(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.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java new file mode 100644 index 0000000000..ff5768e239 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface UpdateUserRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The user to update.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + *
+   * The user to update.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + /** + *
+   * The user to update.
+   * 
+ * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); + + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The field mask to determine which fields are to be updated. If empty, the
+   * server will assume all fields are to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java new file mode 100644 index 0000000000..5eb29fdbbb --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java @@ -0,0 +1,1972 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * A user.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.User} + */ +public final class User extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.User) + UserOrBuilder { +private static final long serialVersionUID = 0L; + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private User() { + name_ = ""; + displayName_ = ""; + email_ = ""; + nickname_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new User(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private User( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + email_ = s; + break; + } + case 34: { + 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 42: { + 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 48: { + bitField0_ |= 0x00000001; + age_ = input.readInt32(); + break; + } + case 57: { + bitField0_ |= 0x00000002; + heightFeet_ = input.readDouble(); + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + nickname_ = s; + break; + } + case 72: { + bitField0_ |= 0x00000008; + enableNotifications_ = 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.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the user.
+   * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+   * The resource name of the user.
+   * 
+ * + * string name = 1; + * @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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + *
+   * The display_name of the user.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+   * The display_name of the user.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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 EMAIL_FIELD_NUMBER = 3; + private volatile java.lang.Object email_; + /** + *
+   * The email address of the user.
+   * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + /** + *
+   * The email address of the user.
+   * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * The timestamp at which the user was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * The timestamp at which the user was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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_; + } + /** + *
+   * The timestamp at which the user was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * The latest timestamp at which the user was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * The latest timestamp at which the user was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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_; + } + /** + *
+   * The latest timestamp at which the user was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int AGE_FIELD_NUMBER = 6; + private int age_; + /** + *
+   * The age of the user in years.
+   * 
+ * + * optional int32 age = 6; + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The age of the user in years.
+   * 
+ * + * optional int32 age = 6; + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + public static final int HEIGHT_FEET_FIELD_NUMBER = 7; + private double heightFeet_; + /** + *
+   * The height of the user in feet.
+   * 
+ * + * optional double height_feet = 7; + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * The height of the user in feet.
+   * 
+ * + * optional double height_feet = 7; + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + public static final int NICKNAME_FIELD_NUMBER = 8; + private volatile java.lang.Object nickname_; + /** + *
+   * The nickname of the user.
+   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+   * 
+ * + * optional string nickname = 8; + * @return Whether the nickname field is set. + */ + @java.lang.Override + public boolean hasNickname() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * The nickname of the user.
+   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+   * 
+ * + * optional string nickname = 8; + * @return The nickname. + */ + @java.lang.Override + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + 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(); + nickname_ = s; + return s; + } + } + /** + *
+   * The nickname of the user.
+   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+   * 
+ * + * optional string nickname = 8; + * @return The bytes for nickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_NOTIFICATIONS_FIELD_NUMBER = 9; + private boolean enableNotifications_; + /** + *
+   * Enables the receiving of notifications. The default is true if unset.
+   * (-- aip.dev/not-precedent: The default for the feature is true.
+   *     Ordinarily, the default for a `bool` field should be false. --)
+   * 
+ * + * optional bool enable_notifications = 9; + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+   * Enables the receiving of notifications. The default is true if unset.
+   * (-- aip.dev/not-precedent: The default for the feature is true.
+   *     Ordinarily, the default for a `bool` field should be false. --)
+   * 
+ * + * optional bool enable_notifications = 9; + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, email_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(6, age_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(7, heightFeet_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, nickname_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(9, enableNotifications_); + } + 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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, email_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getUpdateTime()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, age_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(7, heightFeet_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, nickname_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, enableNotifications_); + } + 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.showcase.v1beta1.User)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.User other = (com.google.showcase.v1beta1.User) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDisplayName() + .equals(other.getDisplayName())) return false; + if (!getEmail() + .equals(other.getEmail())) 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 (hasAge() != other.hasAge()) return false; + if (hasAge()) { + if (getAge() + != other.getAge()) return false; + } + if (hasHeightFeet() != other.hasHeightFeet()) return false; + if (hasHeightFeet()) { + if (java.lang.Double.doubleToLongBits(getHeightFeet()) + != java.lang.Double.doubleToLongBits( + other.getHeightFeet())) return false; + } + if (hasNickname() != other.hasNickname()) return false; + if (hasNickname()) { + if (!getNickname() + .equals(other.getNickname())) return false; + } + if (hasEnableNotifications() != other.hasEnableNotifications()) return false; + if (hasEnableNotifications()) { + if (getEnableNotifications() + != other.getEnableNotifications()) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().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 (hasAge()) { + hash = (37 * hash) + AGE_FIELD_NUMBER; + hash = (53 * hash) + getAge(); + } + if (hasHeightFeet()) { + hash = (37 * hash) + HEIGHT_FEET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getHeightFeet())); + } + if (hasNickname()) { + hash = (37 * hash) + NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getNickname().hashCode(); + } + if (hasEnableNotifications()) { + hash = (37 * hash) + ENABLE_NOTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableNotifications()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.User parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.User parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.User parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.User parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User 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 user.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.User} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.User) + com.google.showcase.v1beta1.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.User.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_ = ""; + + displayName_ = ""; + + email_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + age_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + heightFeet_ = 0D; + bitField0_ = (bitField0_ & ~0x00000002); + nickname_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + enableNotifications_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User getDefaultInstanceForType() { + return com.google.showcase.v1beta1.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.User build() { + com.google.showcase.v1beta1.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User buildPartial() { + com.google.showcase.v1beta1.User result = new com.google.showcase.v1beta1.User(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.displayName_ = displayName_; + result.email_ = email_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + result.age_ = age_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.heightFeet_ = heightFeet_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000004; + } + result.nickname_ = nickname_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enableNotifications_ = enableNotifications_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.User) { + return mergeFrom((com.google.showcase.v1beta1.User)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.User other) { + if (other == com.google.showcase.v1beta1.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasAge()) { + setAge(other.getAge()); + } + if (other.hasHeightFeet()) { + setHeightFeet(other.getHeightFeet()); + } + if (other.hasNickname()) { + bitField0_ |= 0x00000004; + nickname_ = other.nickname_; + onChanged(); + } + if (other.hasEnableNotifications()) { + setEnableNotifications(other.getEnableNotifications()); + } + 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.showcase.v1beta1.User parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.User) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the user.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The resource name of the user.
+     * 
+ * + * string name = 1; + * @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; + } + } + /** + *
+     * The resource name of the user.
+     * 
+ * + * string name = 1; + * @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; + } + /** + *
+     * The resource name of the user.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the user.
+     * 
+ * + * string name = 1; + * @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 displayName_ = ""; + /** + *
+     * The display_name of the user.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * The display_name of the user.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * The display_name of the user.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + /** + *
+     * The display_name of the user.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * The display_name of the user.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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 email_ = ""; + /** + *
+     * The email address of the user.
+     * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The email address of the user.
+     * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for email. + */ + public com.google.protobuf.ByteString + getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The email address of the user.
+     * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + email_ = value; + onChanged(); + return this; + } + /** + *
+     * The email address of the user.
+     * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearEmail() { + + email_ = getDefaultInstance().getEmail(); + onChanged(); + return this; + } + /** + *
+     * The email address of the user.
+     * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + email_ = 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_; + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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(); + } + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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_; + } + } + /** + *
+     * The timestamp at which the user was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + 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_; + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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(); + } + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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_; + } + } + /** + *
+     * The latest timestamp at which the user was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 int age_ ; + /** + *
+     * The age of the user in years.
+     * 
+ * + * optional int32 age = 6; + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * The age of the user in years.
+     * 
+ * + * optional int32 age = 6; + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + /** + *
+     * The age of the user in years.
+     * 
+ * + * optional int32 age = 6; + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + bitField0_ |= 0x00000001; + age_ = value; + onChanged(); + return this; + } + /** + *
+     * The age of the user in years.
+     * 
+ * + * optional int32 age = 6; + * @return This builder for chaining. + */ + public Builder clearAge() { + bitField0_ = (bitField0_ & ~0x00000001); + age_ = 0; + onChanged(); + return this; + } + + private double heightFeet_ ; + /** + *
+     * The height of the user in feet.
+     * 
+ * + * optional double height_feet = 7; + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * The height of the user in feet.
+     * 
+ * + * optional double height_feet = 7; + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + /** + *
+     * The height of the user in feet.
+     * 
+ * + * optional double height_feet = 7; + * @param value The heightFeet to set. + * @return This builder for chaining. + */ + public Builder setHeightFeet(double value) { + bitField0_ |= 0x00000002; + heightFeet_ = value; + onChanged(); + return this; + } + /** + *
+     * The height of the user in feet.
+     * 
+ * + * optional double height_feet = 7; + * @return This builder for chaining. + */ + public Builder clearHeightFeet() { + bitField0_ = (bitField0_ & ~0x00000002); + heightFeet_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object nickname_ = ""; + /** + *
+     * The nickname of the user.
+     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+     * 
+ * + * optional string nickname = 8; + * @return Whether the nickname field is set. + */ + public boolean hasNickname() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The nickname of the user.
+     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+     * 
+ * + * optional string nickname = 8; + * @return The nickname. + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The nickname of the user.
+     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+     * 
+ * + * optional string nickname = 8; + * @return The bytes for nickname. + */ + public com.google.protobuf.ByteString + getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The nickname of the user.
+     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+     * 
+ * + * optional string nickname = 8; + * @param value The nickname to set. + * @return This builder for chaining. + */ + public Builder setNickname( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + nickname_ = value; + onChanged(); + return this; + } + /** + *
+     * The nickname of the user.
+     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+     * 
+ * + * optional string nickname = 8; + * @return This builder for chaining. + */ + public Builder clearNickname() { + bitField0_ = (bitField0_ & ~0x00000004); + nickname_ = getDefaultInstance().getNickname(); + onChanged(); + return this; + } + /** + *
+     * The nickname of the user.
+     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+     * 
+ * + * optional string nickname = 8; + * @param value The bytes for nickname to set. + * @return This builder for chaining. + */ + public Builder setNicknameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000004; + nickname_ = value; + onChanged(); + return this; + } + + private boolean enableNotifications_ ; + /** + *
+     * Enables the receiving of notifications. The default is true if unset.
+     * (-- aip.dev/not-precedent: The default for the feature is true.
+     *     Ordinarily, the default for a `bool` field should be false. --)
+     * 
+ * + * optional bool enable_notifications = 9; + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Enables the receiving of notifications. The default is true if unset.
+     * (-- aip.dev/not-precedent: The default for the feature is true.
+     *     Ordinarily, the default for a `bool` field should be false. --)
+     * 
+ * + * optional bool enable_notifications = 9; + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + /** + *
+     * Enables the receiving of notifications. The default is true if unset.
+     * (-- aip.dev/not-precedent: The default for the feature is true.
+     *     Ordinarily, the default for a `bool` field should be false. --)
+     * 
+ * + * optional bool enable_notifications = 9; + * @param value The enableNotifications to set. + * @return This builder for chaining. + */ + public Builder setEnableNotifications(boolean value) { + bitField0_ |= 0x00000008; + enableNotifications_ = value; + onChanged(); + return this; + } + /** + *
+     * Enables the receiving of notifications. The default is true if unset.
+     * (-- aip.dev/not-precedent: The default for the feature is true.
+     *     Ordinarily, the default for a `bool` field should be false. --)
+     * 
+ * + * optional bool enable_notifications = 9; + * @return This builder for chaining. + */ + public Builder clearEnableNotifications() { + bitField0_ = (bitField0_ & ~0x00000008); + enableNotifications_ = 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.showcase.v1beta1.User) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.User) + private static final com.google.showcase.v1beta1.User DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.User(); + } + + public static com.google.showcase.v1beta1.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new User(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.showcase.v1beta1.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java new file mode 100644 index 0000000000..df5a3618b7 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -0,0 +1,166 @@ +/* + * 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.showcase.v1beta1; + +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 UserName implements ResourceName { + private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected UserName() { + user = null; + } + + private UserName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java new file mode 100644 index 0000000000..25f08bb513 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java @@ -0,0 +1,219 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface UserOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.User) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the user.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the user.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The display_name of the user.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + *
+   * The display_name of the user.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * The email address of the user.
+   * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The email. + */ + java.lang.String getEmail(); + /** + *
+   * The email address of the user.
+   * 
+ * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for email. + */ + com.google.protobuf.ByteString + getEmailBytes(); + + /** + *
+   * The timestamp at which the user was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + *
+   * The timestamp at which the user was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * The timestamp at which the user was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * The latest timestamp at which the user was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + *
+   * The latest timestamp at which the user was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * The latest timestamp at which the user was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + *
+   * The age of the user in years.
+   * 
+ * + * optional int32 age = 6; + * @return Whether the age field is set. + */ + boolean hasAge(); + /** + *
+   * The age of the user in years.
+   * 
+ * + * optional int32 age = 6; + * @return The age. + */ + int getAge(); + + /** + *
+   * The height of the user in feet.
+   * 
+ * + * optional double height_feet = 7; + * @return Whether the heightFeet field is set. + */ + boolean hasHeightFeet(); + /** + *
+   * The height of the user in feet.
+   * 
+ * + * optional double height_feet = 7; + * @return The heightFeet. + */ + double getHeightFeet(); + + /** + *
+   * The nickname of the user.
+   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+   * 
+ * + * optional string nickname = 8; + * @return Whether the nickname field is set. + */ + boolean hasNickname(); + /** + *
+   * The nickname of the user.
+   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+   * 
+ * + * optional string nickname = 8; + * @return The nickname. + */ + java.lang.String getNickname(); + /** + *
+   * The nickname of the user.
+   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
+   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
+   * 
+ * + * optional string nickname = 8; + * @return The bytes for nickname. + */ + com.google.protobuf.ByteString + getNicknameBytes(); + + /** + *
+   * Enables the receiving of notifications. The default is true if unset.
+   * (-- aip.dev/not-precedent: The default for the feature is true.
+   *     Ordinarily, the default for a `bool` field should be false. --)
+   * 
+ * + * optional bool enable_notifications = 9; + * @return Whether the enableNotifications field is set. + */ + boolean hasEnableNotifications(); + /** + *
+   * Enables the receiving of notifications. The default is true if unset.
+   * (-- aip.dev/not-precedent: The default for the feature is true.
+   *     Ordinarily, the default for a `bool` field should be false. --)
+   * 
+ * + * optional bool enable_notifications = 9; + * @return The enableNotifications. + */ + boolean getEnableNotifications(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java new file mode 100644 index 0000000000..5684e2d672 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface VerifyTestRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The test to have an answer registered to it.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The test to have an answer registered to it.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The answer from the test.
+   * 
+ * + * bytes answer = 2; + * @return The answer. + */ + com.google.protobuf.ByteString getAnswer(); + + /** + *
+   * The answers from the test if multiple are to be checked
+   * 
+ * + * repeated bytes answers = 3; + * @return A list containing the answers. + */ + java.util.List getAnswersList(); + /** + *
+   * The answers from the test if multiple are to be checked
+   * 
+ * + * repeated bytes answers = 3; + * @return The count of answers. + */ + int getAnswersCount(); + /** + *
+   * The answers from the test if multiple are to be checked
+   * 
+ * + * repeated bytes answers = 3; + * @param index The index of the element to return. + * @return The answers at the given index. + */ + com.google.protobuf.ByteString getAnswers(int index); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java new file mode 100644 index 0000000000..d32e612271 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java @@ -0,0 +1,657 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} + */ +public final class VerifyTestResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestResponse) + VerifyTestResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use VerifyTestResponse.newBuilder() to construct. + private VerifyTestResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VerifyTestResponse() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new VerifyTestResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VerifyTestResponse( + 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.showcase.v1beta1.Issue.Builder subBuilder = null; + if (issue_ != null) { + subBuilder = issue_.toBuilder(); + } + issue_ = input.readMessage(com.google.showcase.v1beta1.Issue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(issue_); + issue_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + public static final int ISSUE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Issue issue_; + /** + *
+   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return issue_ != null; + } + /** + *
+   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + /** + *
+   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return getIssue(); + } + + 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 (issue_ != null) { + output.writeMessage(1, getIssue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (issue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getIssue()); + } + 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.showcase.v1beta1.VerifyTestResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestResponse other = (com.google.showcase.v1beta1.VerifyTestResponse) obj; + + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue() + .equals(other.getIssue())) 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 (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse 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; + } + /** + * Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestResponse) + com.google.showcase.v1beta1.VerifyTestResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestResponse.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 (issueBuilder_ == null) { + issue_ = null; + } else { + issue_ = null; + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse build() { + com.google.showcase.v1beta1.VerifyTestResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse buildPartial() { + com.google.showcase.v1beta1.VerifyTestResponse result = new com.google.showcase.v1beta1.VerifyTestResponse(this); + if (issueBuilder_ == null) { + result.issue_ = issue_; + } else { + result.issue_ = issueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.VerifyTestResponse) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestResponse other) { + if (other == com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance()) return this; + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + 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.showcase.v1beta1.VerifyTestResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.VerifyTestResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> issueBuilder_; + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return issueBuilder_ != null || issue_ != null; + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + onChanged(); + } else { + issueBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue( + com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + onChanged(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (issue_ != null) { + issue_ = + com.google.showcase.v1beta1.Issue.newBuilder(issue_).mergeFrom(value).buildPartial(); + } else { + issue_ = value; + } + onChanged(); + } else { + issueBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder clearIssue() { + if (issueBuilder_ == null) { + issue_ = null; + onChanged(); + } else { + issue_ = null; + issueBuilder_ = null; + } + + return this; + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + + onChanged(); + return getIssueFieldBuilder().getBuilder(); + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? + com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + /** + *
+     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+     * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), + getParentForChildren(), + isClean()); + issue_ = null; + } + return issueBuilder_; + } + @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.showcase.v1beta1.VerifyTestResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestResponse) + private static final com.google.showcase.v1beta1.VerifyTestResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestResponse(); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VerifyTestResponse(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.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java new file mode 100644 index 0000000000..60f479d81e --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface VerifyTestResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + * @return Whether the issue field is set. + */ + boolean hasIssue(); + /** + *
+   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + /** + *
+   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
+   * 
+ * + * .google.showcase.v1beta1.Issue issue = 1; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java new file mode 100644 index 0000000000..260e24d7b6 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java @@ -0,0 +1,665 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The metadata for Wait operation.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ +public final class WaitMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitMetadata) + WaitMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use WaitMetadata.newBuilder() to construct. + private WaitMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WaitMetadata() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WaitMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WaitMetadata( + 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 (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + public static final int END_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + 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 (endTime_ != null) { + output.writeMessage(1, getEndTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEndTime()); + } + 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.showcase.v1beta1.WaitMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitMetadata other = (com.google.showcase.v1beta1.WaitMetadata) obj; + + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime() + .equals(other.getEndTime())) 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 (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata 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; + } + /** + *
+   * The metadata for Wait operation.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitMetadata) + com.google.showcase.v1beta1.WaitMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitMetadata.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 (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata build() { + com.google.showcase.v1beta1.WaitMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata buildPartial() { + com.google.showcase.v1beta1.WaitMetadata result = new com.google.showcase.v1beta1.WaitMetadata(this); + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.WaitMetadata) { + return mergeFrom((com.google.showcase.v1beta1.WaitMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitMetadata other) { + if (other == com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance()) return this; + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + 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.showcase.v1beta1.WaitMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.WaitMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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_; + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @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(); + } + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + 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; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + 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; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + 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_; + } + @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.showcase.v1beta1.WaitMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitMetadata) + private static final com.google.showcase.v1beta1.WaitMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitMetadata(); + } + + public static com.google.showcase.v1beta1.WaitMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WaitMetadata(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.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java new file mode 100644 index 0000000000..c672abe3f4 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface WaitMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java new file mode 100644 index 0000000000..97d4d2413c --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java @@ -0,0 +1,1631 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The request for Wait method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ +public final class WaitRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitRequest) + WaitRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use WaitRequest.newBuilder() to construct. + private WaitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WaitRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WaitRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WaitRequest( + 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 (endCase_ == 1) { + subBuilder = ((com.google.protobuf.Timestamp) end_).toBuilder(); + } + end_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) end_); + end_ = subBuilder.buildPartial(); + } + endCase_ = 1; + break; + } + case 18: { + com.google.rpc.Status.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = ((com.google.rpc.Status) response_).toBuilder(); + } + response_ = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.rpc.Status) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + break; + } + case 26: { + com.google.showcase.v1beta1.WaitResponse.Builder subBuilder = null; + if (responseCase_ == 3) { + subBuilder = ((com.google.showcase.v1beta1.WaitResponse) response_).toBuilder(); + } + response_ = + input.readMessage(com.google.showcase.v1beta1.WaitResponse.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.WaitResponse) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 3; + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (endCase_ == 4) { + subBuilder = ((com.google.protobuf.Duration) end_).toBuilder(); + } + end_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) end_); + end_ = subBuilder.buildPartial(); + } + endCase_ = 4; + 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.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + private int endCase_ = 0; + private java.lang.Object end_; + public enum EndCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_TIME(1), + TTL(4), + END_NOT_SET(0); + private final int value; + private EndCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EndCase valueOf(int value) { + return forNumber(value); + } + + public static EndCase forNumber(int value) { + switch (value) { + case 1: return END_TIME; + case 4: return TTL; + case 0: return END_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public EndCase + getEndCase() { + return EndCase.forNumber( + endCase_); + } + + private int responseCase_ = 0; + private java.lang.Object response_; + public enum ResponseCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + private ResponseCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: return ERROR; + case 3: return SUCCESS; + case 0: return RESPONSE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ResponseCase + getResponseCase() { + return ResponseCase.forNumber( + responseCase_); + } + + public static final int END_TIME_FIELD_NUMBER = 1; + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 4; + /** + *
+   * The duration of this operation.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + /** + *
+   * The duration of this operation.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + *
+   * The duration of this operation.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + /** + *
+   * The response to be returned on operation completion.
+   * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + /** + *
+   * The response to be returned on operation completion.
+   * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + /** + *
+   * The response to be returned on operation completion.
+   * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (endCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Duration) end_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (com.google.protobuf.Duration) end_); + } + 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.showcase.v1beta1.WaitRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitRequest other = (com.google.showcase.v1beta1.WaitRequest) obj; + + if (!getEndCase().equals(other.getEndCase())) return false; + switch (endCase_) { + case 1: + if (!getEndTime() + .equals(other.getEndTime())) return false; + break; + case 4: + if (!getTtl() + .equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError() + .equals(other.getError())) return false; + break; + case 3: + if (!getSuccess() + .equals(other.getSuccess())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (endCase_) { + case 1: + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + break; + case 4: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest 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; + } + /** + *
+   * The request for Wait method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitRequest) + com.google.showcase.v1beta1.WaitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitRequest.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(); + endCase_ = 0; + end_ = null; + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest build() { + com.google.showcase.v1beta1.WaitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest buildPartial() { + com.google.showcase.v1beta1.WaitRequest result = new com.google.showcase.v1beta1.WaitRequest(this); + if (endCase_ == 1) { + if (endTimeBuilder_ == null) { + result.end_ = end_; + } else { + result.end_ = endTimeBuilder_.build(); + } + } + if (endCase_ == 4) { + if (ttlBuilder_ == null) { + result.end_ = end_; + } else { + result.end_ = ttlBuilder_.build(); + } + } + if (responseCase_ == 2) { + if (errorBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = errorBuilder_.build(); + } + } + if (responseCase_ == 3) { + if (successBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = successBuilder_.build(); + } + } + result.endCase_ = endCase_; + result.responseCase_ = responseCase_; + 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.showcase.v1beta1.WaitRequest) { + return mergeFrom((com.google.showcase.v1beta1.WaitRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitRequest other) { + if (other == com.google.showcase.v1beta1.WaitRequest.getDefaultInstance()) return this; + switch (other.getEndCase()) { + case END_TIME: { + mergeEndTime(other.getEndTime()); + break; + } + case TTL: { + mergeTtl(other.getTtl()); + break; + } + case END_NOT_SET: { + break; + } + } + switch (other.getResponseCase()) { + case ERROR: { + mergeError(other.getError()); + break; + } + case SUCCESS: { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.WaitRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.WaitRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int endCase_ = 0; + private java.lang.Object end_; + public EndCase + getEndCase() { + return EndCase.forNumber( + endCase_); + } + + public Builder clearEnd() { + endCase_ = 0; + end_ = null; + onChanged(); + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + public ResponseCase + getResponseCase() { + return ResponseCase.forNumber( + responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (endCase_ == 1) { + return endTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + endCase_ = 1; + return this; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 1; + return this; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endCase_ == 1 && + end_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + end_ = com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) end_) + .mergeFrom(value).buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 1) { + endTimeBuilder_.mergeFrom(value); + } else { + endTimeBuilder_.setMessage(value); + } + } + endCase_ = 1; + return this; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + } + endTimeBuilder_.clear(); + } + return this; + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if ((endCase_ == 1) && (endTimeBuilder_ != null)) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + *
+     * The time that this operation will complete.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + if (!(endCase_ == 1)) { + end_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) end_, + getParentForChildren(), + isClean()); + end_ = null; + } + endCase_ = 1; + onChanged();; + return endTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> ttlBuilder_; + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (endCase_ == 4) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + endCase_ = 4; + return this; + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl( + com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 4; + return this; + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (endCase_ == 4 && + end_ != com.google.protobuf.Duration.getDefaultInstance()) { + end_ = com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) end_) + .mergeFrom(value).buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 4) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + endCase_ = 4; + return this; + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((endCase_ == 4) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + *
+     * The duration of this operation.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(endCase_ == 4)) { + end_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) end_, + getParentForChildren(), + isClean()); + end_ = null; + } + endCase_ = 4; + onChanged();; + return ttlBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && + response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value).buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + /** + *
+     * The error that will be returned by the server. If this code is specified
+     * to be the OK rpc code, an empty response will be returned.
+     * 
+ * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged();; + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, com.google.showcase.v1beta1.WaitResponse.Builder, com.google.showcase.v1beta1.WaitResponseOrBuilder> successBuilder_; + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess( + com.google.showcase.v1beta1.WaitResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 && + response_ != com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) { + response_ = com.google.showcase.v1beta1.WaitResponse.newBuilder((com.google.showcase.v1beta1.WaitResponse) response_) + .mergeFrom(value).buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public com.google.showcase.v1beta1.WaitResponse.Builder getSuccessBuilder() { + return getSuccessFieldBuilder().getBuilder(); + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + /** + *
+     * The response to be returned on operation completion.
+     * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, com.google.showcase.v1beta1.WaitResponse.Builder, com.google.showcase.v1beta1.WaitResponseOrBuilder> + getSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + successBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, com.google.showcase.v1beta1.WaitResponse.Builder, com.google.showcase.v1beta1.WaitResponseOrBuilder>( + (com.google.showcase.v1beta1.WaitResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged();; + return successBuilder_; + } + @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.showcase.v1beta1.WaitRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitRequest) + private static final com.google.showcase.v1beta1.WaitRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitRequest(); + } + + public static com.google.showcase.v1beta1.WaitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WaitRequest(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.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java new file mode 100644 index 0000000000..1050530f9c --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java @@ -0,0 +1,124 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface WaitRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * The time that this operation will complete.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * The duration of this operation.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + /** + *
+   * The duration of this operation.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + /** + *
+   * The duration of this operation.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return Whether the error field is set. + */ + boolean hasError(); + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + * @return The error. + */ + com.google.rpc.Status getError(); + /** + *
+   * The error that will be returned by the server. If this code is specified
+   * to be the OK rpc code, an empty response will be returned.
+   * 
+ * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + *
+   * The response to be returned on operation completion.
+   * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + * @return Whether the success field is set. + */ + boolean hasSuccess(); + /** + *
+   * The response to be returned on operation completion.
+   * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + * @return The success. + */ + com.google.showcase.v1beta1.WaitResponse getSuccess(); + /** + *
+   * The response to be returned on operation completion.
+   * 
+ * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder(); + + public com.google.showcase.v1beta1.WaitRequest.EndCase getEndCase(); + + public com.google.showcase.v1beta1.WaitRequest.ResponseCase getResponseCase(); +} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java new file mode 100644 index 0000000000..d992163846 --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + *
+ * The result of the Wait operation.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ +public final class WaitResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitResponse) + WaitResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use WaitResponse.newBuilder() to construct. + private WaitResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WaitResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WaitResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WaitResponse( + 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(); + + content_ = 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.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + *
+   * This content of the result.
+   * 
+ * + * string content = 1; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+   * This content of the result.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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.showcase.v1beta1.WaitResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitResponse other = (com.google.showcase.v1beta1.WaitResponse) obj; + + if (!getContent() + .equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse 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; + } + /** + *
+   * The result of the Wait operation.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitResponse) + com.google.showcase.v1beta1.WaitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitResponse.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(); + content_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse build() { + com.google.showcase.v1beta1.WaitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse buildPartial() { + com.google.showcase.v1beta1.WaitResponse result = new com.google.showcase.v1beta1.WaitResponse(this); + result.content_ = content_; + 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.showcase.v1beta1.WaitResponse) { + return mergeFrom((com.google.showcase.v1beta1.WaitResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitResponse other) { + if (other == com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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.showcase.v1beta1.WaitResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.WaitResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+     * This content of the result.
+     * 
+ * + * string content = 1; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * This content of the result.
+     * 
+ * + * string content = 1; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * This content of the result.
+     * 
+ * + * string content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * This content of the result.
+     * 
+ * + * string content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+     * This content of the result.
+     * 
+ * + * string content = 1; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = 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.showcase.v1beta1.WaitResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitResponse) + private static final com.google.showcase.v1beta1.WaitResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitResponse(); + } + + public static com.google.showcase.v1beta1.WaitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WaitResponse(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.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java new file mode 100644 index 0000000000..8c2a127d9a --- /dev/null +++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface WaitResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * This content of the result.
+   * 
+ * + * string content = 1; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+   * This content of the result.
+   * 
+ * + * string content = 1; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); +} From bc16fa07b7c62ae7e84279351ac2f825f1339443 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 16:21:25 -0500 Subject: [PATCH 18/40] chore: upload two coverage reports to sonar --- .github/workflows/sonar.yaml | 7 +-- coverage/pom.xml | 7 +++ gapic-generator-java/pom.xml | 16 ++++++- pom.xml | 6 +++ showcase/gapic-showcase/pom.xml | 60 ++---------------------- showcase/google-cloud-jar-parent/pom.xml | 2 + 6 files changed, 36 insertions(+), 62 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 45457b68ea..936eba1fcf 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -80,12 +80,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - mvn verify \ - -P showcase,sonar \ + mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -B \ - -X \ -Dsonar.verbose=true \ -Dsonar.projectKey=googleapis_gapic-generator-java \ -Dsonar.organization=googleapis \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.javascript.lcov.reportPath=$(bazel info output_path)/_coverage/_coverage_report.dat + -Dsonar.host.url=https://sonarcloud.io diff --git a/coverage/pom.xml b/coverage/pom.xml index 870c156561..a65c0c0a79 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -27,6 +27,7 @@ org.jacoco jacoco-maven-plugin + 0.8.8 report-aggregate @@ -34,6 +35,12 @@ report-aggregate + + + ${project.basedir}/../target/jacoco.exec + ${project.basedir}/../showcase/gapic-showcase/target/jacoco.exec + + diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index deb40e1031..62097824c9 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -6,6 +6,13 @@ gapic-generator-java 0.0.1-SNAPSHOT + + com.google.api + gapic-generator-java-parent + 0.0.1-SNAPSHOT + ../pom.xml + + UTF-8 @@ -262,14 +269,19 @@ report - test + verify report + + + XML + HTML + +
- org.apache.maven.plugins maven-shade-plugin diff --git a/pom.xml b/pom.xml index f4eb5366c4..fc5f88bf88 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,12 @@ coverage + + + ${project.basedir}/target/site/jacoco/jacoco.xml,${project.basedir}/showcase/gapic-showcase/target/site/jacoco/jacoco.xml + + + diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index aca12d92f1..e6062552d5 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -82,71 +82,21 @@ - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - generate-showcase - - exec - - generate-sources - - bazel - - run - //showcase:update_gapic - - - - - org.jacoco jacoco-maven-plugin 0.8.8 - - - prepare-agent-integration - - - - ${project.build.directory}/jacoco-output/jacoco-integration-tests.exec - - failsafe.jacoco.args - - report - report-integration - - - - ${project.build.directory}/jacoco-output/jacoco-integration-tests.exec - - - ${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 3.0.0-M7 - - - - integration-test - verify + report - ${failsafe.jacoco.args} + + XML + HTML + diff --git a/showcase/google-cloud-jar-parent/pom.xml b/showcase/google-cloud-jar-parent/pom.xml index dea102ae94..1453401bcf 100644 --- a/showcase/google-cloud-jar-parent/pom.xml +++ b/showcase/google-cloud-jar-parent/pom.xml @@ -170,6 +170,7 @@ + org.apache.maven.plugins maven-surefire-plugin From a29727da1d994f2f8b7db2d7d11c1e22f347bcb5 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 16:40:38 -0500 Subject: [PATCH 19/40] chore: show proto folder contents during verify_proto --- WORKSPACE | 3 +++ showcase/scripts/verify.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index e73de98dff..de55cfc78c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -125,8 +125,11 @@ http_archive( # Showcase _showcase_commit = "90d73532a0cab753a85f45c158394f24fc21d91a" +_showcase_sha256 = "0f582541a379be0746e6b8bc5af3df511581d4b1f18f7dfb9ce203be1a64cef1" + http_archive( name = "com_google_gapic_showcase", + sha256 = _showcase_sha256, strip_prefix = "gapic-showcase-%s" % _showcase_commit, urls = [ # "https://github.com/googleapis/gapic-showcase/archive/refs/tags/v%s.zip" % _showcase_version, diff --git a/showcase/scripts/verify.sh b/showcase/scripts/verify.sh index 22c330d113..98e47b0fa0 100755 --- a/showcase/scripts/verify.sh +++ b/showcase/scripts/verify.sh @@ -33,6 +33,8 @@ case $1 in tar -xzf "../$PROTO_ARCHIVE" delete_unneeded + echo "Unpacked:" + ls -a "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src/main/proto diff -ru "$SHOWCASE_DIR/$PROTO_PROJECT_DIR"/src "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src ;; From b73930a1c3b0f5080ff032d122a3a726f967ff12 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 17:17:06 -0500 Subject: [PATCH 20/40] fix: only diff proto src/main/java, ignoring src/main/proto --- showcase/scripts/verify.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/showcase/scripts/verify.sh b/showcase/scripts/verify.sh index 98e47b0fa0..ae6ffb4d35 100755 --- a/showcase/scripts/verify.sh +++ b/showcase/scripts/verify.sh @@ -33,9 +33,7 @@ case $1 in tar -xzf "../$PROTO_ARCHIVE" delete_unneeded - echo "Unpacked:" - ls -a "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src/main/proto - diff -ru "$SHOWCASE_DIR/$PROTO_PROJECT_DIR"/src "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src + diff -ru "$SHOWCASE_DIR/$PROTO_PROJECT_DIR"/src/main/java "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src/main/java ;; grpc) From 6cc7e9d5a883ae0a7560245e961acc79a93568dd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 1 Dec 2022 18:01:55 -0500 Subject: [PATCH 21/40] chore(main): release 2.11.0 (#1081) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ version.txt | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c3772c261..5a951b4113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.11.0](https://github.com/googleapis/gapic-generator-java/compare/v2.10.3...v2.11.0) (2022-11-30) + + +### Features + +* **ast:** Array expressions ([#1080](https://github.com/googleapis/gapic-generator-java/issues/1080)) ([bd9532c](https://github.com/googleapis/gapic-generator-java/commit/bd9532c6663f2e8f9d9978cd0a3cffde821960ec)) + + +### Bug Fixes + +* **ast:** Add import generation for annotations on VariableExpr ([#1076](https://github.com/googleapis/gapic-generator-java/issues/1076)) ([f5d5524](https://github.com/googleapis/gapic-generator-java/commit/f5d5524e626f26ef53d4ae6c02118ef70ace205a)) +* **deps:** Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#1088](https://github.com/googleapis/gapic-generator-java/issues/1088)) ([0e75338](https://github.com/googleapis/gapic-generator-java/commit/0e75338dcb083c4cccd35d8682ba9cbe4e314ef8)) +* Support testing nested argument method signatures and 'double' field assertions ([#1094](https://github.com/googleapis/gapic-generator-java/issues/1094)) ([4bf419f](https://github.com/googleapis/gapic-generator-java/commit/4bf419f764e2ecfdac9caf03968f40a8cd564655)) + ## [2.10.3](https://github.com/googleapis/gapic-generator-java/compare/v2.10.2...v2.10.3) (2022-11-01) diff --git a/version.txt b/version.txt index 5f4f65c859..46b81d815a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.10.3 +2.11.0 From fde22dcf6bb3cedf2639a3bb64069aa4e855eaf0 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Thu, 1 Dec 2022 18:05:12 -0500 Subject: [PATCH 22/40] chore: change showcase version to 0.0.1-SNAPSHOT --- coverage/pom.xml | 2 +- showcase/gapic-showcase/pom.xml | 2 +- showcase/google-cloud-jar-parent/pom.xml | 4 ++-- showcase/google-cloud-pom-parent/pom.xml | 2 +- showcase/grpc-gapic-showcase-v1beta1/pom.xml | 4 ++-- showcase/pom.xml | 10 +++++----- showcase/proto-gapic-showcase-v1beta1/pom.xml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/coverage/pom.xml b/coverage/pom.xml index a65c0c0a79..a4d1d08026 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -18,7 +18,7 @@ com.google.cloud gapic-showcase - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index e6062552d5..3fb8da8bd8 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -15,7 +15,7 @@ com.google.cloud gapic-showcase-parent - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT diff --git a/showcase/google-cloud-jar-parent/pom.xml b/showcase/google-cloud-jar-parent/pom.xml index 1453401bcf..fb08b7d163 100644 --- a/showcase/google-cloud-jar-parent/pom.xml +++ b/showcase/google-cloud-jar-parent/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-jar-parent com.google.cloud - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT pom Google Cloud JAR Parent @@ -15,7 +15,7 @@ com.google.cloud google-cloud-pom-parent - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT ../google-cloud-pom-parent/pom.xml diff --git a/showcase/google-cloud-pom-parent/pom.xml b/showcase/google-cloud-pom-parent/pom.xml index 8a48863524..b80e337e78 100644 --- a/showcase/google-cloud-pom-parent/pom.xml +++ b/showcase/google-cloud-pom-parent/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-pom-parent com.google.cloud - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT pom Google Cloud POM Parent diff --git a/showcase/grpc-gapic-showcase-v1beta1/pom.xml b/showcase/grpc-gapic-showcase-v1beta1/pom.xml index bf8c5a49a2..1ad831dd4e 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/pom.xml +++ b/showcase/grpc-gapic-showcase-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-gapic-showcase-v1beta1 - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT grpc-gapic-showcase-v1beta1 GRPC library for grpc-google-cloud-iot-v1 com.google.cloud gapic-showcase-parent - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT diff --git a/showcase/pom.xml b/showcase/pom.xml index dfaa5164e2..492df39e2f 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -6,7 +6,7 @@ com.google.cloud gapic-showcase-parent pom - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT GAPIC Showcase Client Core Parent Java idiomatic client for Google Cloud Platform services. @@ -15,7 +15,7 @@ com.google.cloud google-cloud-jar-parent - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT ./google-cloud-jar-parent/pom.xml @@ -31,17 +31,17 @@ com.google.api.grpc proto-gapic-showcase-v1beta1 - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT com.google.api.grpc grpc-gapic-showcase-v1beta1 - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT com.google.cloud gapic-showcase - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT diff --git a/showcase/proto-gapic-showcase-v1beta1/pom.xml b/showcase/proto-gapic-showcase-v1beta1/pom.xml index 1d553364b1..de1e1247d3 100644 --- a/showcase/proto-gapic-showcase-v1beta1/pom.xml +++ b/showcase/proto-gapic-showcase-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-gapic-showcase-v1beta1 - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT proto-gapic-showcase-v1beta1 PROTO library for proto-gapic-showcase-v1beta1 com.google.cloud gapic-showcase-parent - 0.0.0-SNAPSHOT + 0.0.1-SNAPSHOT From c7329fdc6cd8d9ad2c6fbdf1e650878ce910f72f Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Fri, 2 Dec 2022 09:06:54 -0500 Subject: [PATCH 23/40] chore: add mvn -version to sonar workflow --- .github/workflows/sonar.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 936eba1fcf..5af244b225 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -25,6 +25,7 @@ jobs: java-version: 11 distribution: temurin - run: java -version + - run: mvn -version - name: Bazel File Cache Setup id: cache-bazel From a1fe3e01382c0b346776fcb2a6ff437c3eb09439 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Fri, 2 Dec 2022 09:32:34 -0500 Subject: [PATCH 24/40] fix: set showcase client to 0.0.1-SNAPSHOT --- showcase/gapic-showcase/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 3fb8da8bd8..c76ce1d052 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.google.cloud gapic-showcase - 0.0.0-SHAPSHOT + 0.0.1-SHAPSHOT jar GAPIC Showcase Client From 32b01eccd401b7edd4893bcff5a04960f0ef645d Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Fri, 2 Dec 2022 09:51:42 -0500 Subject: [PATCH 25/40] fix: explicitly set shade plugin output directory --- gapic-generator-java/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 62097824c9..1c9395f90a 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -293,6 +293,7 @@ shade + ../target false From 9c5ee07a639d0bf33cfefa012bbf3434a30d9391 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Fri, 2 Dec 2022 10:09:27 -0500 Subject: [PATCH 26/40] chore: remove aggregator from build --- coverage/pom.xml | 68 ++++++++++++++++++++++-------------------------- pom.xml | 1 - 2 files changed, 31 insertions(+), 38 deletions(-) diff --git a/coverage/pom.xml b/coverage/pom.xml index a4d1d08026..231da7a5b4 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -7,43 +7,37 @@ gapic-generator-java-coverage-aggregate 0.0.1-SNAPSHOT pom - Aggregate Report + Aggregate Coverage Report - - - com.google.api - gapic-generator-java - 0.0.1-SNAPSHOT - - - com.google.cloud - gapic-showcase - 0.0.1-SNAPSHOT - - + + + com.google.api + gapic-generator-java + 0.0.1-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + + - - - - org.jacoco - jacoco-maven-plugin - 0.8.8 - - - report-aggregate - verify - - report-aggregate - - - - ${project.basedir}/../target/jacoco.exec - ${project.basedir}/../showcase/gapic-showcase/target/jacoco.exec - - - - - - - + + + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + report-aggregate + verify + + report-aggregate + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc5f88bf88..b50563e9f0 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,6 @@ gapic-generator-java showcase - coverage From c1593eb7cc011d504c2487bc7c0e0a1688d5674b Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Fri, 2 Dec 2022 10:38:30 -0500 Subject: [PATCH 27/40] fix: coverage report locations --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b50563e9f0..caa9640cdc 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ - ${project.basedir}/target/site/jacoco/jacoco.xml,${project.basedir}/showcase/gapic-showcase/target/site/jacoco/jacoco.xml + target/site/jacoco/jacoco.xml,showcase/gapic-showcase/target/site/jacoco/jacoco.xml From b7358f53d9f306a32eb1d002c443adfa532073f5 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Fri, 2 Dec 2022 10:42:27 -0500 Subject: [PATCH 28/40] fix: skip linting on generated showcase files --- showcase/gapic-showcase/pom.xml | 4 ++++ showcase/grpc-gapic-showcase-v1beta1/pom.xml | 4 ++++ showcase/proto-gapic-showcase-v1beta1/pom.xml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index c76ce1d052..7c6cdc7960 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -18,6 +18,10 @@ 0.0.1-SNAPSHOT + + true + + diff diff --git a/showcase/grpc-gapic-showcase-v1beta1/pom.xml b/showcase/grpc-gapic-showcase-v1beta1/pom.xml index 1ad831dd4e..18a2c4cca4 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/pom.xml +++ b/showcase/grpc-gapic-showcase-v1beta1/pom.xml @@ -13,6 +13,10 @@ 0.0.1-SNAPSHOT + + true + + diff diff --git a/showcase/proto-gapic-showcase-v1beta1/pom.xml b/showcase/proto-gapic-showcase-v1beta1/pom.xml index de1e1247d3..56f290bb87 100644 --- a/showcase/proto-gapic-showcase-v1beta1/pom.xml +++ b/showcase/proto-gapic-showcase-v1beta1/pom.xml @@ -13,6 +13,10 @@ 0.0.1-SNAPSHOT + + true + + diff From 60dc1904676b1ede343b84998658eca2e20cc56a Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Mon, 5 Dec 2022 11:52:14 -0500 Subject: [PATCH 29/40] fix: sonar coverage for non-standard directory structure (#1108) --- gapic-generator-java/pom.xml | 3 +++ pom.xml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index deb40e1031..9cee0d5c03 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -10,6 +10,9 @@ UTF-8 44d6bef0ca6db8bba3fb324c8186e694bcc4829c + .. + ../src/main/java,pom.xml + ../target/sonar diff --git a/pom.xml b/pom.xml index ad31faffd7..be2d2b4eea 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,14 @@ gapic-generator-java + + + ${project.basedir}/target/site/jacoco/jacoco.xml + + pom.xml + + + From ba0dcd2ed72ba489dd299a053eca6bd83e9f52bc Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 5 Dec 2022 15:52:56 -0500 Subject: [PATCH 30/40] fix: exclude generated showcase from license header check --- .github/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8d18cba83b..f389dada1c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,8 +19,11 @@ jobs: go-version: '^1.13.1' - name: License Header Check run: | - go install github.com/google/addlicense@latest - addlicense -c "Google LLC" -l apache -check $(find $PWD -type f -name '*.java' ! -iname '*PlaceholderFile.java') + go install github.com/google/addlicense@latest + addlicense -c "Google LLC" -l apache -check $(find $PWD \ + -path ./showcase -prune \ + -type f -name '*.java' ! -iname '*PlaceholderFile.java' \ + -print) build: needs: license-header From 0e0287dc177ad60a010b6d28233f9689486bd361 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 5 Dec 2022 15:57:25 -0500 Subject: [PATCH 31/40] fix: single-line 'find' syntax --- .github/workflows/ci.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f389dada1c..9853296ea4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,10 +20,7 @@ jobs: - name: License Header Check run: | go install github.com/google/addlicense@latest - addlicense -c "Google LLC" -l apache -check $(find $PWD \ - -path ./showcase -prune \ - -type f -name '*.java' ! -iname '*PlaceholderFile.java' \ - -print) + addlicense -c "Google LLC" -l apache -check $(find $PWD -path ./showcase -prune -type f -name '*.java' ! -iname '*PlaceholderFile.java' -print) build: needs: license-header From a35db60015377bf8beee1eb8120c4703908a3578 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 5 Dec 2022 16:31:38 -0500 Subject: [PATCH 32/40] fix: use provided ignore flag --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9853296ea4..7631933473 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: License Header Check run: | go install github.com/google/addlicense@latest - addlicense -c "Google LLC" -l apache -check $(find $PWD -path ./showcase -prune -type f -name '*.java' ! -iname '*PlaceholderFile.java' -print) + addlicense -c "Google LLC" -l apache -ignore showcase/** -check $(find $PWD -type f -name '*.java' ! -iname '*PlaceholderFile.java') build: needs: license-header From 06333d52dfe7358b8f0cf64f42838245b27a76f2 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 10:18:14 -0500 Subject: [PATCH 33/40] ci(showcase): rework github actions for showcase golden and integration tests --- .github/workflows/ci-maven.yaml | 59 +++++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 58 -------------------------------- 2 files changed, 59 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci-maven.yaml b/.github/workflows/ci-maven.yaml index 095586df2f..02513e4315 100644 --- a/.github/workflows/ci-maven.yaml +++ b/.github/workflows/ci-maven.yaml @@ -3,7 +3,12 @@ on: branches: - main pull_request: + name: ci-maven + +env: + SHOWCASE_VERSION: 0.25.0 + jobs: build: runs-on: ubuntu-latest @@ -32,3 +37,57 @@ jobs: - name: Java Linter run: mvn fmt:check + + showcase: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 8, 11 ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: temurin + - run: java -version + + - name: Bazel File Cache Setup + id: cache-bazel + uses: actions/cache@v3 + with: + path: ~/.cache/bazel + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }} + - name: Bazel Cache Not Found + if: steps.cache-bazel.outputs.cache-hit != 'true' + run: | + echo "No cache found." + - name: Bazel Cache Found + if: steps.cache-bazel.outputs.cache-hit == 'true' + run: | + echo -n "Cache found. Cache size: " + du -sh ~/.cache/bazel + echo "If the cache seems broken, update the CACHE_VERSION secret in" + echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions" + echo "(use any random string, any GUID will work)" + echo "and it will start over with a clean cache." + echo "The old one will disappear after 7 days." + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y curl unzip + - name: Install showcase server + run: | + sudo mkdir -p /usr/src/showcase + sudo chown -R ${USER} /usr/src/ + curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz + cd /usr/src/showcase/ + tar -xf showcase-* + ./gapic-showcase run & + cd - + + - name: Showcase integration tests + run: | + cd showcase + mvn verify -P enable-integration-tests + cd - diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7631933473..ff32b61a7c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,6 @@ jobs: run: | go install github.com/google/addlicense@latest addlicense -c "Google LLC" -l apache -ignore showcase/** -check $(find $PWD -type f -name '*.java' ! -iname '*PlaceholderFile.java') - build: needs: license-header runs-on: ubuntu-latest @@ -107,60 +106,3 @@ jobs: - name: Generate Code Coverage Report # Run only test targets, and not golden_update targets. run: bazel coverage //:units --combined_report=lcov - - showcase: - # needs: build - runs-on: ubuntu-latest - # services: - # showcase-server: - # image: gcr.io/gapic-images/gapic-showcase:0.25.0 - # ports: - # - "7469:7469" - strategy: - matrix: - java: [ 8, 11 ] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: temurin - - run: java -version - - - name: Bazel File Cache Setup - id: cache-bazel - uses: actions/cache@v3 - with: - path: ~/.cache/bazel - key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }} - - - name: Bazel Cache Not Found - if: steps.cache-bazel.outputs.cache-hit != 'true' - run: | - echo "No cache found." - - name: Bazel Cache Found - if: steps.cache-bazel.outputs.cache-hit == 'true' - run: | - echo -n "Cache found. Cache size: " - du -sh ~/.cache/bazel - echo "If the cache seems broken, update the CACHE_VERSION secret in" - echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions" - echo "(use any random string, any GUID will work)" - echo "and it will start over with a clean cache." - echo "The old one will disappear after 7 days." - - - name: Install system dependencies. - run: | - sudo apt-get update - sudo apt-get install -y curl unzip - - name: Install showcase - run: | - sudo mkdir -p /usr/src/showcase - sudo chown -R ${USER} /usr/src/ - curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz - cd /usr/src/showcase/ - tar -xf showcase-* - ./gapic-showcase run & - cd - - - name: Showcase Integration Testing - run: bazel --batch test //test/showcase/... From 31eaefdbc296343d069d5f1c81eafd228ca4fafe Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 10:18:44 -0500 Subject: [PATCH 34/40] ci(showcase): simplify sonar github actions workflow --- .github/workflows/sonar.yaml | 38 ------------------------------------ 1 file changed, 38 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 5af244b225..2825ff486c 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -7,9 +7,6 @@ on: pull_request: types: [ opened, synchronize, reopened ] -env: - SHOWCASE_VERSION: 0.25.0 - jobs: build: name: Build @@ -27,27 +24,6 @@ jobs: - run: java -version - run: mvn -version - - name: Bazel File Cache Setup - id: cache-bazel - uses: actions/cache@v3 - with: - path: ~/.cache/bazel - key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }} - - name: Bazel Cache Not Found - if: steps.cache-bazel.outputs.cache-hit != 'true' - run: | - echo "No cache found." - - name: Bazel Cache Found - if: steps.cache-bazel.outputs.cache-hit == 'true' - run: | - echo -n "Cache found. Cache size: " - du -sh ~/.cache/bazel - echo "If the cache seems broken, update the CACHE_VERSION secret in" - echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions" - echo "(use any random string, any GUID will work)" - echo "and it will start over with a clean cache." - echo "The old one will disappear after 7 days." - - name: Cache SonarCloud packages uses: actions/cache@v3 with: @@ -55,20 +31,6 @@ jobs: key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Install system dependencies. - run: | - sudo apt-get update - sudo apt-get install -y curl unzip - - name: Install showcase - run: | - sudo mkdir -p /usr/src/showcase - sudo chown -R ${USER} /usr/src/ - curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz - cd /usr/src/showcase/ - tar -xf showcase-* - ./gapic-showcase run & - cd - - - name: Cache Maven packages uses: actions/cache@v3 with: From 84a39e4f68b0ad15d0a32ad621a28d32831e9e13 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 10:19:37 -0500 Subject: [PATCH 35/40] ci(showcase): remove showcase from /test/integration golden suite --- test/BUILD.bazel | 1 - test/integration/BUILD.bazel | 54 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 39 - .../create/SyncCreateSetEndpoint.java | 41 - .../compliance/getenum/AsyncGetEnum.java | 45 - .../compliance/getenum/SyncGetEnum.java | 42 - .../repeatdatabody/AsyncRepeatDataBody.java | 59 - .../repeatdatabody/SyncRepeatDataBody.java | 55 - .../AsyncRepeatDataBodyInfo.java | 59 - .../SyncRepeatDataBodyInfo.java | 55 - .../AsyncRepeatDataBodyPatch.java | 59 - .../SyncRepeatDataBodyPatch.java | 55 - .../AsyncRepeatDataBodyPut.java | 59 - .../SyncRepeatDataBodyPut.java | 55 - .../AsyncRepeatDataPathResource.java | 59 - .../SyncRepeatDataPathResource.java | 55 - .../AsyncRepeatDataPathTrailingResource.java | 59 - .../SyncRepeatDataPathTrailingResource.java | 55 - .../repeatdataquery/AsyncRepeatDataQuery.java | 59 - .../repeatdataquery/SyncRepeatDataQuery.java | 55 - .../AsyncRepeatDataSimplePath.java | 59 - .../SyncRepeatDataSimplePath.java | 55 - .../verifyenum/AsyncVerifyEnum.java | 50 - .../compliance/verifyenum/SyncVerifyEnum.java | 47 - .../repeatdatabody/SyncRepeatDataBody.java | 48 - .../v1beta1/echo/block/AsyncBlock.java | 47 - .../v1beta1/echo/block/SyncBlock.java | 44 - .../showcase/v1beta1/echo/chat/AsyncChat.java | 53 - .../v1beta1/echo/collect/AsyncCollect.java | 68 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 39 - .../echo/create/SyncCreateSetEndpoint.java | 40 - .../showcase/v1beta1/echo/echo/AsyncEcho.java | 51 - .../showcase/v1beta1/echo/echo/SyncEcho.java | 48 - .../v1beta1/echo/expand/AsyncExpand.java | 51 - .../echo/pagedexpand/AsyncPagedExpand.java | 52 - .../pagedexpand/AsyncPagedExpandPaged.java | 60 - .../echo/pagedexpand/SyncPagedExpand.java | 49 - .../AsyncPagedExpandLegacy.java | 51 - .../SyncPagedExpandLegacy.java | 47 - .../AsyncPagedExpandLegacyMapped.java | 54 - .../AsyncPagedExpandLegacyMappedPaged.java | 62 - .../SyncPagedExpandLegacyMapped.java | 51 - .../showcase/v1beta1/echo/wait/AsyncWait.java | 45 - .../v1beta1/echo/wait/AsyncWaitLRO.java | 47 - .../showcase/v1beta1/echo/wait/SyncWait.java | 42 - .../v1beta1/echosettings/echo/SyncEcho.java | 48 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 39 - .../create/SyncCreateSetEndpoint.java | 41 - .../identity/createuser/AsyncCreateUser.java | 46 - .../identity/createuser/SyncCreateUser.java | 43 - .../SyncCreateUserStringString.java | 42 - ...serStringStringIntStringBooleanDouble.java | 48 - .../identity/deleteuser/AsyncDeleteUser.java | 47 - .../identity/deleteuser/SyncDeleteUser.java | 44 - .../deleteuser/SyncDeleteUserString.java | 42 - .../deleteuser/SyncDeleteUserUsername.java | 42 - .../identity/getuser/AsyncGetUser.java | 47 - .../v1beta1/identity/getuser/SyncGetUser.java | 44 - .../identity/getuser/SyncGetUserString.java | 42 - .../identity/getuser/SyncGetUserUsername.java | 42 - .../identity/listusers/AsyncListUsers.java | 51 - .../listusers/AsyncListUsersPaged.java | 59 - .../identity/listusers/SyncListUsers.java | 48 - .../identity/updateuser/AsyncUpdateUser.java | 50 - .../identity/updateuser/SyncUpdateUser.java | 47 - .../createuser/SyncCreateUser.java | 48 - .../messaging/connect/AsyncConnect.java | 48 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 39 - .../create/SyncCreateSetEndpoint.java | 41 - .../createblurb/AsyncCreateBlurb.java | 50 - .../createblurb/SyncCreateBlurb.java | 47 - ...reateBlurbProfilenameStringBytestring.java | 46 - ...yncCreateBlurbProfilenameStringString.java | 45 - ...ateBlurbProfilenameUsernameBytestring.java | 46 - ...cCreateBlurbProfilenameUsernameString.java | 45 - ...ncCreateBlurbRoomnameStringBytestring.java | 46 - .../SyncCreateBlurbRoomnameStringString.java | 45 - ...CreateBlurbRoomnameUsernameBytestring.java | 46 - ...SyncCreateBlurbRoomnameUsernameString.java | 45 - ...SyncCreateBlurbStringStringBytestring.java | 46 - .../SyncCreateBlurbStringStringString.java | 45 - ...ncCreateBlurbStringUsernameBytestring.java | 46 - .../SyncCreateBlurbStringUsernameString.java | 45 - .../messaging/createroom/AsyncCreateRoom.java | 46 - .../messaging/createroom/SyncCreateRoom.java | 43 - .../SyncCreateRoomStringString.java | 42 - .../deleteblurb/AsyncDeleteBlurb.java | 49 - .../deleteblurb/SyncDeleteBlurb.java | 46 - .../deleteblurb/SyncDeleteBlurbBlurbname.java | 42 - .../deleteblurb/SyncDeleteBlurbString.java | 43 - .../messaging/deleteroom/AsyncDeleteRoom.java | 47 - .../messaging/deleteroom/SyncDeleteRoom.java | 44 - .../deleteroom/SyncDeleteRoomRoomname.java | 42 - .../deleteroom/SyncDeleteRoomString.java | 42 - .../messaging/getblurb/AsyncGetBlurb.java | 49 - .../messaging/getblurb/SyncGetBlurb.java | 46 - .../getblurb/SyncGetBlurbBlurbname.java | 42 - .../getblurb/SyncGetBlurbString.java | 43 - .../messaging/getroom/AsyncGetRoom.java | 47 - .../messaging/getroom/SyncGetRoom.java | 44 - .../getroom/SyncGetRoomRoomname.java | 42 - .../messaging/getroom/SyncGetRoomString.java | 42 - .../messaging/listblurbs/AsyncListBlurbs.java | 53 - .../listblurbs/AsyncListBlurbsPaged.java | 61 - .../messaging/listblurbs/SyncListBlurbs.java | 50 - .../listblurbs/SyncListBlurbsProfilename.java | 44 - .../listblurbs/SyncListBlurbsRoomname.java | 44 - .../listblurbs/SyncListBlurbsString.java | 44 - .../messaging/listrooms/AsyncListRooms.java | 51 - .../listrooms/AsyncListRoomsPaged.java | 59 - .../messaging/listrooms/SyncListRooms.java | 48 - .../searchblurbs/AsyncSearchBlurbs.java | 52 - .../searchblurbs/AsyncSearchBlurbsLRO.java | 54 - .../searchblurbs/SyncSearchBlurbs.java | 49 - .../SyncSearchBlurbsProfilenameString.java | 43 - .../SyncSearchBlurbsRoomnameString.java | 43 - .../SyncSearchBlurbsStringString.java | 43 - .../messaging/sendblurbs/AsyncSendBlurbs.java | 68 - .../streamblurbs/AsyncStreamBlurbs.java | 53 - .../updateblurb/AsyncUpdateBlurb.java | 50 - .../updateblurb/SyncUpdateBlurb.java | 47 - .../messaging/updateroom/AsyncUpdateRoom.java | 50 - .../messaging/updateroom/SyncUpdateRoom.java | 47 - .../createroom/SyncCreateRoom.java | 48 - .../attemptsequence/AsyncAttemptSequence.java | 49 - .../attemptsequence/SyncAttemptSequence.java | 46 - .../SyncAttemptSequenceSequencename.java | 42 - .../SyncAttemptSequenceString.java | 42 - .../SyncCreateSetCredentialsProvider.java | 45 - .../SyncCreateSetCredentialsProvider1.java | 41 - .../create/SyncCreateSetEndpoint.java | 42 - .../createsequence/AsyncCreateSequence.java | 47 - .../createsequence/SyncCreateSequence.java | 43 - .../SyncCreateSequenceSequence.java | 41 - .../AsyncGetSequenceReport.java | 50 - .../SyncGetSequenceReport.java | 46 - ...ncGetSequenceReportSequencereportname.java | 42 - .../SyncGetSequenceReportString.java | 42 - .../createsequence/SyncCreateSequence.java | 49 - .../repeatdatabody/SyncRepeatDataBody.java | 48 - .../stub/echostubsettings/echo/SyncEcho.java | 48 - .../createuser/SyncCreateUser.java | 48 - .../createroom/SyncCreateRoom.java | 48 - .../createsequence/SyncCreateSequence.java | 49 - .../createsession/SyncCreateSession.java | 48 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 39 - .../testing/create/SyncCreateSetEndpoint.java | 40 - .../createsession/AsyncCreateSession.java | 46 - .../createsession/SyncCreateSession.java | 43 - .../deletesession/AsyncDeleteSession.java | 47 - .../deletesession/SyncDeleteSession.java | 44 - .../testing/deletetest/AsyncDeleteTest.java | 49 - .../testing/deletetest/SyncDeleteTest.java | 46 - .../testing/getsession/AsyncGetSession.java | 47 - .../testing/getsession/SyncGetSession.java | 44 - .../listsessions/AsyncListSessions.java | 51 - .../listsessions/AsyncListSessionsPaged.java | 59 - .../listsessions/SyncListSessions.java | 48 - .../testing/listtests/AsyncListTests.java | 53 - .../listtests/AsyncListTestsPaged.java | 61 - .../testing/listtests/SyncListTests.java | 50 - .../reportsession/AsyncReportSession.java | 48 - .../reportsession/SyncReportSession.java | 44 - .../testing/verifytest/AsyncVerifyTest.java | 53 - .../testing/verifytest/SyncVerifyTest.java | 50 - .../createsession/SyncCreateSession.java | 48 - .../google/showcase/v1beta1/BlurbName.java | 473 ---- .../showcase/v1beta1/ComplianceClient.java | 946 -------- .../v1beta1/ComplianceClientHttpJsonTest.java | 917 ------- .../v1beta1/ComplianceClientTest.java | 740 ------ .../showcase/v1beta1/ComplianceSettings.java | 297 --- .../google/showcase/v1beta1/EchoClient.java | 999 -------- .../v1beta1/EchoClientHttpJsonTest.java | 431 ---- .../showcase/v1beta1/EchoClientTest.java | 562 ----- .../google/showcase/v1beta1/EchoSettings.java | 315 --- .../showcase/v1beta1/IdentityClient.java | 774 ------ .../v1beta1/IdentityClientHttpJsonTest.java | 520 ---- .../showcase/v1beta1/IdentityClientTest.java | 462 ---- .../showcase/v1beta1/IdentitySettings.java | 251 -- .../showcase/v1beta1/MessagingClient.java | 2117 ----------------- .../v1beta1/MessagingClientHttpJsonTest.java | 1649 ------------- .../showcase/v1beta1/MessagingClientTest.java | 1614 ------------- .../showcase/v1beta1/MessagingSettings.java | 364 --- .../showcase/v1beta1/MockCompliance.java | 59 - .../showcase/v1beta1/MockComplianceImpl.java | 268 --- .../com/google/showcase/v1beta1/MockEcho.java | 59 - .../google/showcase/v1beta1/MockEchoImpl.java | 277 --- .../google/showcase/v1beta1/MockIdentity.java | 59 - .../showcase/v1beta1/MockIdentityImpl.java | 162 -- .../showcase/v1beta1/MockMessaging.java | 59 - .../showcase/v1beta1/MockMessagingImpl.java | 380 --- .../showcase/v1beta1/MockSequenceService.java | 59 - .../v1beta1/MockSequenceServiceImpl.java | 124 - .../google/showcase/v1beta1/MockTesting.java | 59 - .../showcase/v1beta1/MockTestingImpl.java | 226 -- .../google/showcase/v1beta1/ProfileName.java | 168 -- .../com/google/showcase/v1beta1/RoomName.java | 166 -- .../google/showcase/v1beta1/SequenceName.java | 168 -- .../showcase/v1beta1/SequenceReportName.java | 168 -- .../v1beta1/SequenceServiceClient.java | 498 ---- .../SequenceServiceClientHttpJsonTest.java | 290 --- .../v1beta1/SequenceServiceClientTest.java | 264 -- .../v1beta1/SequenceServiceSettings.java | 229 -- .../google/showcase/v1beta1/SessionName.java | 168 -- .../com/google/showcase/v1beta1/TestName.java | 191 -- .../showcase/v1beta1/TestingClient.java | 880 ------- .../v1beta1/TestingClientHttpJsonTest.java | 472 ---- .../showcase/v1beta1/TestingClientTest.java | 433 ---- .../showcase/v1beta1/TestingSettings.java | 286 --- .../com/google/showcase/v1beta1/UserName.java | 166 -- .../showcase/v1beta1/gapic_metadata.json | 210 -- .../google/showcase/v1beta1/package-info.java | 162 -- .../showcase/v1beta1/stub/ComplianceStub.java | 81 - .../v1beta1/stub/ComplianceStubSettings.java | 526 ---- .../showcase/v1beta1/stub/EchoStub.java | 116 - .../v1beta1/stub/EchoStubSettings.java | 713 ------ .../stub/GrpcComplianceCallableFactory.java | 115 - .../v1beta1/stub/GrpcComplianceStub.java | 397 ---- .../v1beta1/stub/GrpcEchoCallableFactory.java | 115 - .../showcase/v1beta1/stub/GrpcEchoStub.java | 413 ---- .../stub/GrpcIdentityCallableFactory.java | 115 - .../v1beta1/stub/GrpcIdentityStub.java | 272 --- .../stub/GrpcMessagingCallableFactory.java | 115 - .../v1beta1/stub/GrpcMessagingStub.java | 562 ----- .../GrpcSequenceServiceCallableFactory.java | 115 - .../v1beta1/stub/GrpcSequenceServiceStub.java | 223 -- .../stub/GrpcTestingCallableFactory.java | 115 - .../v1beta1/stub/GrpcTestingStub.java | 378 --- .../HttpJsonComplianceCallableFactory.java | 105 - .../v1beta1/stub/HttpJsonComplianceStub.java | 772 ------ .../stub/HttpJsonEchoCallableFactory.java | 105 - .../v1beta1/stub/HttpJsonEchoStub.java | 562 ----- .../stub/HttpJsonIdentityCallableFactory.java | 105 - .../v1beta1/stub/HttpJsonIdentityStub.java | 406 ---- .../HttpJsonMessagingCallableFactory.java | 105 - .../v1beta1/stub/HttpJsonMessagingStub.java | 823 ------- ...ttpJsonSequenceServiceCallableFactory.java | 105 - .../stub/HttpJsonSequenceServiceStub.java | 302 --- .../stub/HttpJsonTestingCallableFactory.java | 105 - .../v1beta1/stub/HttpJsonTestingStub.java | 572 ----- .../showcase/v1beta1/stub/IdentityStub.java | 70 - .../v1beta1/stub/IdentityStubSettings.java | 491 ---- .../showcase/v1beta1/stub/MessagingStub.java | 144 -- .../v1beta1/stub/MessagingStubSettings.java | 815 ------- .../v1beta1/stub/SequenceServiceStub.java | 54 - .../stub/SequenceServiceStubSettings.java | 387 --- .../showcase/v1beta1/stub/TestingStub.java | 93 - .../v1beta1/stub/TestingStubSettings.java | 612 ----- test/showcase/BUILD.bazel | 59 - .../com/google/showcase/v1beta1/BUILD.bazel | 40 - .../google/showcase/v1beta1/FirstHttpIT.java | 71 - .../google/showcase/v1beta1/FirstRpcIT.java | 62 - .../showcase/v1beta1/NumericEnumsIT.java | 68 - 258 files changed, 39684 deletions(-) delete mode 100644 test/BUILD.bazel delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java delete mode 100644 test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/BlurbName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClient.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClient.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClient.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentitySettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClient.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockCompliance.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockComplianceImpl.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEcho.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEchoImpl.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentity.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentityImpl.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessaging.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessagingImpl.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceService.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceServiceImpl.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTesting.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTestingImpl.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ProfileName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/RoomName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceReportName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClient.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SessionName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClient.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientTest.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/UserName.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/gapic_metadata.json delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/package-info.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStubSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStubSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStubSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStub.java delete mode 100644 test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStubSettings.java delete mode 100644 test/showcase/BUILD.bazel delete mode 100644 test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel delete mode 100644 test/showcase/src/test/com/google/showcase/v1beta1/FirstHttpIT.java delete mode 100644 test/showcase/src/test/com/google/showcase/v1beta1/FirstRpcIT.java delete mode 100644 test/showcase/src/test/com/google/showcase/v1beta1/NumericEnumsIT.java diff --git a/test/BUILD.bazel b/test/BUILD.bazel deleted file mode 100644 index ffd0fb0cdc..0000000000 --- a/test/BUILD.bazel +++ /dev/null @@ -1 +0,0 @@ -package(default_visibility = ["//visibility:public"]) diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel index eef719f35e..3ae62f374a 100644 --- a/test/integration/BUILD.bazel +++ b/test/integration/BUILD.bazel @@ -16,8 +16,6 @@ package(default_visibility = ["//visibility:public"]) API_GAPIC_TARGETS = { # basic case "asset": "@com_google_googleapis//google/cloud/asset/v1:asset_java_gapic", - # Showcase provides wide feature set coverage. - "showcase": "//test/showcase:showcase_java_gapic", # Check that the capital name edge case is handled. "credentials": "@com_google_googleapis//google/iam/credentials/v1:credentials_java_gapic", # Mixin-only special-case API can build on its own. @@ -80,20 +78,6 @@ java_gapic_test( runtime_deps = ["@com_google_googleapis//google/cloud/asset/v1:asset_java_gapic_test"], ) -# Showcase API. -java_gapic_test( - name = "showcase_java_gapic_test_suite", - test_classes = [ - "com.google.showcase.v1beta1.ComplianceClientTest", - "com.google.showcase.v1beta1.EchoClientTest", - "com.google.showcase.v1beta1.IdentityClientTest", - "com.google.showcase.v1beta1.MessagingClientTest", - "com.google.showcase.v1beta1.SequenceServiceClientTest", - "com.google.showcase.v1beta1.TestingClientTest", - ], - runtime_deps = ["//test/showcase:showcase_java_gapic_test"], -) - # Redis API. java_gapic_test( name = "redis_java_gapic_test_suite", @@ -271,41 +255,3 @@ java_gapic_test( ], runtime_deps = [":pubsub_java_gapic_test"], ) - -SHOWCASE_DEPS = [ - "//test/showcase:showcase_java_grpc", - "//test/showcase:showcase_java_proto", - "@com_google_api_api_common//jar", - "@com_google_api_gax_java//gax-grpc:gax_grpc", - "@com_google_api_gax_java//gax-grpc:gax_grpc_testlib", - "@com_google_api_gax_java//gax-httpjson:gax_httpjson", - "@com_google_api_gax_java//gax-httpjson:gax_httpjson_testlib", - "@com_google_api_gax_java//gax:gax", - "@com_google_api_gax_java//gax:gax_testlib", - "@com_google_auth_google_auth_library_credentials//jar", - "@com_google_auth_google_auth_library_oauth2_http//jar", - "@com_google_code_findbugs_jsr305//jar", - "@com_google_code_gson_gson//jar", - "@com_google_googleapis//google/longrunning:longrunning_java_proto", - "@com_google_googleapis//google/rpc:rpc_java_proto", - "@com_google_googleapis//google/type:type_java_proto", - "@com_google_guava_guava//jar", - "@com_google_http_client_google_http_client//jar", - "@com_google_protobuf//:protobuf_java", - "@io_grpc_grpc_java//auth:auth", - "@io_grpc_grpc_java//core:core", - "@io_grpc_grpc_java//protobuf:protobuf", - "@io_grpc_grpc_java//stub:stub", - "@io_grpc_grpc_netty_shaded//jar", - "@io_opencensus_opencensus_api//jar", - "@io_opencensus_opencensus_contrib_grpc_metrics//jar", - "@javax_annotation_javax_annotation_api//jar", - "@junit_junit//jar", - "@org_threeten_threetenbp//jar", -] - -java_library( - name = "generated_showcase", - srcs = glob(["goldens/showcase/src/**/*.java"]), - deps = SHOWCASE_DEPS, -) diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 46846134bb..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; -import com.google.showcase.v1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - ComplianceSettings complianceSettings = - ComplianceSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); - } -} -// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index f28602378a..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build(); - ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); - } -} -// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider1_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 40b937f7f3..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; -import com.google.showcase.v1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - ComplianceSettings complianceSettings = - ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build(); - ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); - } -} -// [END localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java deleted file mode 100644 index 464c666e72..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_GetEnum_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; - -public class AsyncGetEnum { - - public static void main(String[] args) throws Exception { - asyncGetEnum(); - } - - public static void asyncGetEnum() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - ApiFuture future = complianceClient.getEnumCallable().futureCall(request); - // Do something. - EnumResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_GetEnum_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java deleted file mode 100644 index 25e134f2a3..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_GetEnum_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; - -public class SyncGetEnum { - - public static void main(String[] args) throws Exception { - syncGetEnum(); - } - - public static void syncGetEnum() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - EnumResponse response = complianceClient.getEnum(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_GetEnum_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java deleted file mode 100644 index 02379d2e01..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBody_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - asyncRepeatDataBody(); - } - - public static void asyncRepeatDataBody() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataBodyCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBody_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java deleted file mode 100644 index 9769ea47da..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - syncRepeatDataBody(); - } - - public static void syncRepeatDataBody() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataBody(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java deleted file mode 100644 index 80138be72f..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataBodyInfo { - - public static void main(String[] args) throws Exception { - asyncRepeatDataBodyInfo(); - } - - public static void asyncRepeatDataBodyInfo() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataBodyInfoCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java deleted file mode 100644 index c3b00bd27e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataBodyInfo { - - public static void main(String[] args) throws Exception { - syncRepeatDataBodyInfo(); - } - - public static void syncRepeatDataBodyInfo() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataBodyInfo(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyInfo_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java deleted file mode 100644 index d62dcd97b9..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataBodyPatch { - - public static void main(String[] args) throws Exception { - asyncRepeatDataBodyPatch(); - } - - public static void asyncRepeatDataBodyPatch() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataBodyPatchCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java deleted file mode 100644 index 1e53216e8d..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataBodyPatch { - - public static void main(String[] args) throws Exception { - syncRepeatDataBodyPatch(); - } - - public static void syncRepeatDataBodyPatch() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataBodyPatch(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPatch_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java deleted file mode 100644 index 61fb607032..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataBodyPut { - - public static void main(String[] args) throws Exception { - asyncRepeatDataBodyPut(); - } - - public static void asyncRepeatDataBodyPut() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataBodyPutCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java deleted file mode 100644 index 4f4d65a084..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataBodyPut { - - public static void main(String[] args) throws Exception { - syncRepeatDataBodyPut(); - } - - public static void syncRepeatDataBodyPut() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataBodyPut(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyPut_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java deleted file mode 100644 index 020978c742..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataPathResource { - - public static void main(String[] args) throws Exception { - asyncRepeatDataPathResource(); - } - - public static void asyncRepeatDataPathResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataPathResourceCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java deleted file mode 100644 index 3a0e60981f..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataPathResource { - - public static void main(String[] args) throws Exception { - syncRepeatDataPathResource(); - } - - public static void syncRepeatDataPathResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataPathResource(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathResource_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java deleted file mode 100644 index 1c3b305371..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataPathTrailingResource { - - public static void main(String[] args) throws Exception { - asyncRepeatDataPathTrailingResource(); - } - - public static void asyncRepeatDataPathTrailingResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java deleted file mode 100644 index 73883a1773..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataPathTrailingResource { - - public static void main(String[] args) throws Exception { - syncRepeatDataPathTrailingResource(); - } - - public static void syncRepeatDataPathTrailingResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataPathTrailingResource(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataPathTrailingResource_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java deleted file mode 100644 index c174e28a01..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataQuery { - - public static void main(String[] args) throws Exception { - asyncRepeatDataQuery(); - } - - public static void asyncRepeatDataQuery() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataQueryCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java deleted file mode 100644 index 2f4dd67b42..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataQuery { - - public static void main(String[] args) throws Exception { - syncRepeatDataQuery(); - } - - public static void syncRepeatDataQuery() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataQuery(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataQuery_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java deleted file mode 100644 index ff20f79853..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class AsyncRepeatDataSimplePath { - - public static void main(String[] args) throws Exception { - asyncRepeatDataSimplePath(); - } - - public static void asyncRepeatDataSimplePath() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - ApiFuture future = - complianceClient.repeatDataSimplePathCallable().futureCall(request); - // Do something. - RepeatResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java deleted file mode 100644 index 4cec930750..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataSimplePath { - - public static void main(String[] args) throws Exception { - syncRepeatDataSimplePath(); - } - - public static void syncRepeatDataSimplePath() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataSimplePath(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataSimplePath_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java deleted file mode 100644 index ceae5e5edc..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_VerifyEnum_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.Continent; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; - -public class AsyncVerifyEnum { - - public static void main(String[] args) throws Exception { - asyncVerifyEnum(); - } - - public static void asyncVerifyEnum() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request); - // Do something. - EnumResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_VerifyEnum_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java deleted file mode 100644 index cf742f475d..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_VerifyEnum_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.Continent; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; - -public class SyncVerifyEnum { - - public static void main(String[] args) throws Exception { - syncVerifyEnum(); - } - - public static void syncVerifyEnum() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (ComplianceClient complianceClient = ComplianceClient.create()) { - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - EnumResponse response = complianceClient.verifyEnum(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_VerifyEnum_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java deleted file mode 100644 index 50c6680f41..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] -import com.google.showcase.v1beta1.ComplianceSettings; -import java.time.Duration; - -public class SyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - syncRepeatDataBody(); - } - - public static void syncRepeatDataBody() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder(); - complianceSettingsBuilder - .repeatDataBodySettings() - .setRetrySettings( - complianceSettingsBuilder - .repeatDataBodySettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java deleted file mode 100644 index 5d1e13ec6b..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Block_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Duration; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoClient; - -public class AsyncBlock { - - public static void main(String[] args) throws Exception { - asyncBlock(); - } - - public static void asyncBlock() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - ApiFuture future = echoClient.blockCallable().futureCall(request); - // Do something. - BlockResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Block_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java deleted file mode 100644 index 33e753f91c..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Block_sync] -import com.google.protobuf.Duration; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoClient; - -public class SyncBlock { - - public static void main(String[] args) throws Exception { - syncBlock(); - } - - public static void syncBlock() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - BlockResponse response = echoClient.block(request); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Block_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java deleted file mode 100644 index fc7ae4a2fd..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Chat_async] -import com.google.api.gax.rpc.BidiStream; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.Severity; - -public class AsyncChat { - - public static void main(String[] args) throws Exception { - asyncChat(); - } - - public static void asyncChat() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - BidiStream bidiStream = echoClient.chatCallable().call(); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - bidiStream.send(request); - for (EchoResponse response : bidiStream) { - // Do something when a response is received. - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Chat_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java deleted file mode 100644 index faace6e726..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Collect_async] -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.Severity; - -public class AsyncCollect { - - public static void main(String[] args) throws Exception { - asyncCollect(); - } - - public static void asyncCollect() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - ApiStreamObserver responseObserver = - new ApiStreamObserver() { - @Override - public void onNext(EchoResponse response) { - // Do something when a response is received. - } - - @Override - public void onError(Throwable t) { - // Add error-handling - } - - @Override - public void onCompleted() { - // Do something when complete. - } - }; - ApiStreamObserver requestObserver = - echoClient.collect().clientStreamingCall(responseObserver); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - requestObserver.onNext(request); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Collect_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index a9ebbf7ae9..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoSettings; -import com.google.showcase.v1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - EchoSettings echoSettings = - EchoSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - EchoClient echoClient = EchoClient.create(echoSettings); - } -} -// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index cb6c708da6..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build(); - EchoClient echoClient = EchoClient.create(echoSettings); - } -} -// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider1_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java deleted file mode 100644 index ad36585408..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoSettings; -import com.google.showcase.v1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build(); - EchoClient echoClient = EchoClient.create(echoSettings); - } -} -// [END localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java deleted file mode 100644 index 705e8c273b..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Echo_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.Severity; - -public class AsyncEcho { - - public static void main(String[] args) throws Exception { - asyncEcho(); - } - - public static void asyncEcho() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - ApiFuture future = echoClient.echoCallable().futureCall(request); - // Do something. - EchoResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Echo_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java deleted file mode 100644 index 37388425b1..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Echo_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.Severity; - -public class SyncEcho { - - public static void main(String[] args) throws Exception { - syncEcho(); - } - - public static void syncEcho() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - EchoResponse response = echoClient.echo(request); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Echo_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java deleted file mode 100644 index 80c5f6d6b4..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Expand_async] -import com.google.api.gax.rpc.ServerStream; -import com.google.rpc.Status; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; - -public class AsyncExpand { - - public static void main(String[] args) throws Exception { - asyncExpand(); - } - - public static void asyncExpand() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - ExpandRequest request = - ExpandRequest.newBuilder() - .setContent("content951530617") - .setError(Status.newBuilder().build()) - .build(); - ServerStream stream = echoClient.expandCallable().call(request); - for (EchoResponse response : stream) { - // Do something when a response is received. - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Expand_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java deleted file mode 100644 index 46257d1453..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpand_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.PagedExpandRequest; - -public class AsyncPagedExpand { - - public static void main(String[] args) throws Exception { - asyncPagedExpand(); - } - - public static void asyncPagedExpand() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request); - // Do something. - for (EchoResponse element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpand_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java deleted file mode 100644 index 28a19a69af..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpand_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; - -public class AsyncPagedExpandPaged { - - public static void main(String[] args) throws Exception { - asyncPagedExpandPaged(); - } - - public static void asyncPagedExpandPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - PagedExpandResponse response = echoClient.pagedExpandCallable().call(request); - for (EchoResponse element : response.getResponsesList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpand_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java deleted file mode 100644 index c9c1a85279..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpand_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.PagedExpandRequest; - -public class SyncPagedExpand { - - public static void main(String[] args) throws Exception { - syncPagedExpand(); - } - - public static void syncPagedExpand() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (EchoResponse element : echoClient.pagedExpand(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpand_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java deleted file mode 100644 index 624e4caec1..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; - -public class AsyncPagedExpandLegacy { - - public static void main(String[] args) throws Exception { - asyncPagedExpandLegacy(); - } - - public static void asyncPagedExpandLegacy() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = - echoClient.pagedExpandLegacyCallable().futureCall(request); - // Do something. - PagedExpandResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java deleted file mode 100644 index c82b7bbae7..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; - -public class SyncPagedExpandLegacy { - - public static void main(String[] args) throws Exception { - syncPagedExpandLegacy(); - } - - public static void syncPagedExpandLegacy() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - PagedExpandResponse response = echoClient.pagedExpandLegacy(request); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacy_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java deleted file mode 100644 index be038a2fb5..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponseList; -import java.util.Map; - -public class AsyncPagedExpandLegacyMapped { - - public static void main(String[] args) throws Exception { - asyncPagedExpandLegacyMapped(); - } - - public static void asyncPagedExpandLegacyMapped() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture> future = - echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request); - // Do something. - for (Map.Entry element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java deleted file mode 100644 index 538a3247e8..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponseList; -import java.util.Map; - -public class AsyncPagedExpandLegacyMappedPaged { - - public static void main(String[] args) throws Exception { - asyncPagedExpandLegacyMappedPaged(); - } - - public static void asyncPagedExpandLegacyMappedPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - PagedExpandLegacyMappedResponse response = - echoClient.pagedExpandLegacyMappedCallable().call(request); - for (Map.Entry element : response.getAlphabetizedList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java deleted file mode 100644 index 2b644c8837..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponseList; -import java.util.Map; - -public class SyncPagedExpandLegacyMapped { - - public static void main(String[] args) throws Exception { - syncPagedExpandLegacyMapped(); - } - - public static void syncPagedExpandLegacyMapped() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (Map.Entry element : - echoClient.pagedExpandLegacyMapped(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Echo_PagedExpandLegacyMapped_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java deleted file mode 100644 index 4fe1f78ed2..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Wait_async] -import com.google.api.core.ApiFuture; -import com.google.longrunning.Operation; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.WaitRequest; - -public class AsyncWait { - - public static void main(String[] args) throws Exception { - asyncWait(); - } - - public static void asyncWait() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - WaitRequest request = WaitRequest.newBuilder().build(); - ApiFuture future = echoClient.waitCallable().futureCall(request); - // Do something. - Operation response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Wait_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java deleted file mode 100644 index 450ec96d94..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Wait_LRO_async] -import com.google.api.gax.longrunning.OperationFuture; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; - -public class AsyncWaitLRO { - - public static void main(String[] args) throws Exception { - asyncWaitLRO(); - } - - public static void asyncWaitLRO() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - WaitRequest request = WaitRequest.newBuilder().build(); - OperationFuture future = - echoClient.waitOperationCallable().futureCall(request); - // Do something. - WaitResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Wait_LRO_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java deleted file mode 100644 index b79a0c4abe..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Wait_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; - -public class SyncWait { - - public static void main(String[] args) throws Exception { - syncWait(); - } - - public static void syncWait() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (EchoClient echoClient = EchoClient.create()) { - WaitRequest request = WaitRequest.newBuilder().build(); - WaitResponse response = echoClient.waitAsync(request).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Wait_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java deleted file mode 100644 index 8297f9021e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_EchoSettings_Echo_sync] -import com.google.showcase.v1beta1.EchoSettings; -import java.time.Duration; - -public class SyncEcho { - - public static void main(String[] args) throws Exception { - syncEcho(); - } - - public static void syncEcho() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); - echoSettingsBuilder - .echoSettings() - .setRetrySettings( - echoSettingsBuilder - .echoSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - EchoSettings echoSettings = echoSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_EchoSettings_Echo_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 2ebcf3d498..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.IdentitySettings; -import com.google.showcase.v1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - IdentitySettings identitySettings = - IdentitySettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - IdentityClient identityClient = IdentityClient.create(identitySettings); - } -} -// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 4ef4b5c388..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.IdentitySettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build(); - IdentityClient identityClient = IdentityClient.create(identitySettings); - } -} -// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider1_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 56a9453ba2..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.IdentitySettings; -import com.google.showcase.v1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - IdentitySettings identitySettings = - IdentitySettings.newBuilder().setEndpoint(myEndpoint).build(); - IdentityClient identityClient = IdentityClient.create(identitySettings); - } -} -// [END localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java deleted file mode 100644 index 6159e29f8b..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_CreateUser_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; - -public class AsyncCreateUser { - - public static void main(String[] args) throws Exception { - asyncCreateUser(); - } - - public static void asyncCreateUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - CreateUserRequest request = - CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build(); - ApiFuture future = identityClient.createUserCallable().futureCall(request); - // Do something. - User response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_CreateUser_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java deleted file mode 100644 index efced6437d..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_CreateUser_sync] -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; - -public class SyncCreateUser { - - public static void main(String[] args) throws Exception { - syncCreateUser(); - } - - public static void syncCreateUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - CreateUserRequest request = - CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build(); - User response = identityClient.createUser(request); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_CreateUser_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java deleted file mode 100644 index 54552b0fae..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_CreateUser_StringString_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; - -public class SyncCreateUserStringString { - - public static void main(String[] args) throws Exception { - syncCreateUserStringString(); - } - - public static void syncCreateUserStringString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - String displayName = "displayName1714148973"; - String email = "email96619420"; - User response = identityClient.createUser(displayName, email); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_CreateUser_StringString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java deleted file mode 100644 index 61705d69f3..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_CreateUser_StringStringIntStringBooleanDouble_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; - -public class SyncCreateUserStringStringIntStringBooleanDouble { - - public static void main(String[] args) throws Exception { - syncCreateUserStringStringIntStringBooleanDouble(); - } - - public static void syncCreateUserStringStringIntStringBooleanDouble() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - User response = - identityClient.createUser( - displayName, email, age, nickname, enableNotifications, heightFeet); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_CreateUser_StringStringIntStringBooleanDouble_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java deleted file mode 100644 index 8d8de43b47..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_DeleteUser_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.UserName; - -public class AsyncDeleteUser { - - public static void main(String[] args) throws Exception { - asyncDeleteUser(); - } - - public static void asyncDeleteUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - DeleteUserRequest request = - DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); - ApiFuture future = identityClient.deleteUserCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_DeleteUser_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java deleted file mode 100644 index 9bdce522e9..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_DeleteUser_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.UserName; - -public class SyncDeleteUser { - - public static void main(String[] args) throws Exception { - syncDeleteUser(); - } - - public static void syncDeleteUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - DeleteUserRequest request = - DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); - identityClient.deleteUser(request); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_DeleteUser_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java deleted file mode 100644 index bb894748d3..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_DeleteUser_String_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.UserName; - -public class SyncDeleteUserString { - - public static void main(String[] args) throws Exception { - syncDeleteUserString(); - } - - public static void syncDeleteUserString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - String name = UserName.of("[USER]").toString(); - identityClient.deleteUser(name); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_DeleteUser_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java deleted file mode 100644 index b61c33d83c..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_DeleteUser_Username_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.UserName; - -public class SyncDeleteUserUsername { - - public static void main(String[] args) throws Exception { - syncDeleteUserUsername(); - } - - public static void syncDeleteUserUsername() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - UserName name = UserName.of("[USER]"); - identityClient.deleteUser(name); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_DeleteUser_Username_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java deleted file mode 100644 index 640d726784..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_GetUser_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; -import com.google.showcase.v1beta1.UserName; - -public class AsyncGetUser { - - public static void main(String[] args) throws Exception { - asyncGetUser(); - } - - public static void asyncGetUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - GetUserRequest request = - GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); - ApiFuture future = identityClient.getUserCallable().futureCall(request); - // Do something. - User response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_GetUser_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java deleted file mode 100644 index 9e6adc257c..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_GetUser_sync] -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; -import com.google.showcase.v1beta1.UserName; - -public class SyncGetUser { - - public static void main(String[] args) throws Exception { - syncGetUser(); - } - - public static void syncGetUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - GetUserRequest request = - GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build(); - User response = identityClient.getUser(request); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_GetUser_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java deleted file mode 100644 index 3443054f45..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_GetUser_String_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; -import com.google.showcase.v1beta1.UserName; - -public class SyncGetUserString { - - public static void main(String[] args) throws Exception { - syncGetUserString(); - } - - public static void syncGetUserString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - String name = UserName.of("[USER]").toString(); - User response = identityClient.getUser(name); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_GetUser_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java deleted file mode 100644 index 53313b1f09..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_GetUser_Username_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; -import com.google.showcase.v1beta1.UserName; - -public class SyncGetUserUsername { - - public static void main(String[] args) throws Exception { - syncGetUserUsername(); - } - - public static void syncGetUserUsername() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - UserName name = UserName.of("[USER]"); - User response = identityClient.getUser(name); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_GetUser_Username_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java deleted file mode 100644 index b72d2c1f7f..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_ListUsers_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.User; - -public class AsyncListUsers { - - public static void main(String[] args) throws Exception { - asyncListUsers(); - } - - public static void asyncListUsers() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request); - // Do something. - for (User element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Identity_ListUsers_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java deleted file mode 100644 index 50351698b4..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_ListUsers_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.User; - -public class AsyncListUsersPaged { - - public static void main(String[] args) throws Exception { - asyncListUsersPaged(); - } - - public static void asyncListUsersPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListUsersResponse response = identityClient.listUsersCallable().call(request); - for (User element : response.getUsersList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Identity_ListUsers_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java deleted file mode 100644 index ea0578c12a..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_ListUsers_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.User; - -public class SyncListUsers { - - public static void main(String[] args) throws Exception { - syncListUsers(); - } - - public static void syncListUsers() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (User element : identityClient.listUsers(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Identity_ListUsers_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java deleted file mode 100644 index 5d2fc84649..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_UpdateUser_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.FieldMask; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; - -public class AsyncUpdateUser { - - public static void main(String[] args) throws Exception { - asyncUpdateUser(); - } - - public static void asyncUpdateUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser(User.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = identityClient.updateUserCallable().futureCall(request); - // Do something. - User response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_UpdateUser_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java deleted file mode 100644 index 23b62e3bbc..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_UpdateUser_sync] -import com.google.protobuf.FieldMask; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; - -public class SyncUpdateUser { - - public static void main(String[] args) throws Exception { - syncUpdateUser(); - } - - public static void syncUpdateUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (IdentityClient identityClient = IdentityClient.create()) { - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser(User.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - User response = identityClient.updateUser(request); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_UpdateUser_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java deleted file mode 100644 index ecc969af0e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] -import com.google.showcase.v1beta1.IdentitySettings; -import java.time.Duration; - -public class SyncCreateUser { - - public static void main(String[] args) throws Exception { - syncCreateUser(); - } - - public static void syncCreateUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder(); - identitySettingsBuilder - .createUserSettings() - .setRetrySettings( - identitySettingsBuilder - .createUserSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - IdentitySettings identitySettings = identitySettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java deleted file mode 100644 index 34f70c0c41..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Connect_async] -import com.google.api.gax.rpc.BidiStream; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.StreamBlurbsResponse; - -public class AsyncConnect { - - public static void main(String[] args) throws Exception { - asyncConnect(); - } - - public static void asyncConnect() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - BidiStream bidiStream = - messagingClient.connectCallable().call(); - ConnectRequest request = ConnectRequest.newBuilder().build(); - bidiStream.send(request); - for (StreamBlurbsResponse response : bidiStream) { - // Do something when a response is received. - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_Connect_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index c6c26a4fae..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.MessagingSettings; -import com.google.showcase.v1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - MessagingSettings messagingSettings = - MessagingSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - MessagingClient messagingClient = MessagingClient.create(messagingSettings); - } -} -// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index ac54a1ca4e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.MessagingSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build(); - MessagingClient messagingClient = MessagingClient.create(messagingSettings); - } -} -// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider1_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 0380588c4a..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.MessagingSettings; -import com.google.showcase.v1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - MessagingSettings messagingSettings = - MessagingSettings.newBuilder().setEndpoint(myEndpoint).build(); - MessagingClient messagingClient = MessagingClient.create(messagingSettings); - } -} -// [END localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java deleted file mode 100644 index ab21cabfa7..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class AsyncCreateBlurb { - - public static void main(String[] args) throws Exception { - asyncCreateBlurb(); - } - - public static void asyncCreateBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - ApiFuture future = messagingClient.createBlurbCallable().futureCall(request); - // Do something. - Blurb response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java deleted file mode 100644 index 10f979355d..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class SyncCreateBlurb { - - public static void main(String[] args) throws Exception { - syncCreateBlurb(); - } - - public static void syncCreateBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - Blurb response = messagingClient.createBlurb(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java deleted file mode 100644 index 8fe16595eb..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringBytestring_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbProfilenameStringBytestring { - - public static void main(String[] args) throws Exception { - syncCreateBlurbProfilenameStringBytestring(); - } - - public static void syncCreateBlurbProfilenameStringBytestring() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ProfileName parent = ProfileName.of("[USER]"); - String user = UserName.of("[USER]").toString(); - ByteString image = ByteString.EMPTY; - Blurb response = messagingClient.createBlurb(parent, user, image); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringBytestring_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java deleted file mode 100644 index 5d4c8e8986..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringString_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbProfilenameStringString { - - public static void main(String[] args) throws Exception { - syncCreateBlurbProfilenameStringString(); - } - - public static void syncCreateBlurbProfilenameStringString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ProfileName parent = ProfileName.of("[USER]"); - String user = UserName.of("[USER]").toString(); - String text = "text3556653"; - Blurb response = messagingClient.createBlurb(parent, user, text); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameStringString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java deleted file mode 100644 index 9c3d7b8c98..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameBytestring_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbProfilenameUsernameBytestring { - - public static void main(String[] args) throws Exception { - syncCreateBlurbProfilenameUsernameBytestring(); - } - - public static void syncCreateBlurbProfilenameUsernameBytestring() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - Blurb response = messagingClient.createBlurb(parent, user, image); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameBytestring_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java deleted file mode 100644 index f431a92155..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameString_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbProfilenameUsernameString { - - public static void main(String[] args) throws Exception { - syncCreateBlurbProfilenameUsernameString(); - } - - public static void syncCreateBlurbProfilenameUsernameString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - Blurb response = messagingClient.createBlurb(parent, user, text); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_ProfilenameUsernameString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java deleted file mode 100644 index 477ed0b163..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringBytestring_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbRoomnameStringBytestring { - - public static void main(String[] args) throws Exception { - syncCreateBlurbRoomnameStringBytestring(); - } - - public static void syncCreateBlurbRoomnameStringBytestring() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName parent = RoomName.of("[ROOM]"); - String user = UserName.of("[USER]").toString(); - ByteString image = ByteString.EMPTY; - Blurb response = messagingClient.createBlurb(parent, user, image); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringBytestring_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java deleted file mode 100644 index 07dc451756..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringString_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbRoomnameStringString { - - public static void main(String[] args) throws Exception { - syncCreateBlurbRoomnameStringString(); - } - - public static void syncCreateBlurbRoomnameStringString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName parent = RoomName.of("[ROOM]"); - String user = UserName.of("[USER]").toString(); - String text = "text3556653"; - Blurb response = messagingClient.createBlurb(parent, user, text); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameStringString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java deleted file mode 100644 index a4cff9e110..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameBytestring_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbRoomnameUsernameBytestring { - - public static void main(String[] args) throws Exception { - syncCreateBlurbRoomnameUsernameBytestring(); - } - - public static void syncCreateBlurbRoomnameUsernameBytestring() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - Blurb response = messagingClient.createBlurb(parent, user, image); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameBytestring_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java deleted file mode 100644 index 5e71b33344..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameString_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbRoomnameUsernameString { - - public static void main(String[] args) throws Exception { - syncCreateBlurbRoomnameUsernameString(); - } - - public static void syncCreateBlurbRoomnameUsernameString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - Blurb response = messagingClient.createBlurb(parent, user, text); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_RoomnameUsernameString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java deleted file mode 100644 index bfed9b8941..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringBytestring_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbStringStringBytestring { - - public static void main(String[] args) throws Exception { - syncCreateBlurbStringStringBytestring(); - } - - public static void syncCreateBlurbStringStringBytestring() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String parent = ProfileName.of("[USER]").toString(); - String user = UserName.of("[USER]").toString(); - ByteString image = ByteString.EMPTY; - Blurb response = messagingClient.createBlurb(parent, user, image); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringBytestring_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java deleted file mode 100644 index f2611ad321..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringString_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbStringStringString { - - public static void main(String[] args) throws Exception { - syncCreateBlurbStringStringString(); - } - - public static void syncCreateBlurbStringStringString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String parent = ProfileName.of("[USER]").toString(); - String user = UserName.of("[USER]").toString(); - String text = "text3556653"; - Blurb response = messagingClient.createBlurb(parent, user, text); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringStringString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java deleted file mode 100644 index 20ac75deb0..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameBytestring_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbStringUsernameBytestring { - - public static void main(String[] args) throws Exception { - syncCreateBlurbStringUsernameBytestring(); - } - - public static void syncCreateBlurbStringUsernameBytestring() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String parent = ProfileName.of("[USER]").toString(); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - Blurb response = messagingClient.createBlurb(parent, user, image); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameBytestring_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java deleted file mode 100644 index a9a3cd4af8..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameString_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.UserName; - -public class SyncCreateBlurbStringUsernameString { - - public static void main(String[] args) throws Exception { - syncCreateBlurbStringUsernameString(); - } - - public static void syncCreateBlurbStringUsernameString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String parent = ProfileName.of("[USER]").toString(); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - Blurb response = messagingClient.createBlurb(parent, user, text); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateBlurb_StringUsernameString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java deleted file mode 100644 index 70a76f23b0..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class AsyncCreateRoom { - - public static void main(String[] args) throws Exception { - asyncCreateRoom(); - } - - public static void asyncCreateRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - CreateRoomRequest request = - CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build(); - ApiFuture future = messagingClient.createRoomCallable().futureCall(request); - // Do something. - Room response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java deleted file mode 100644 index 5aa1b3e94e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class SyncCreateRoom { - - public static void main(String[] args) throws Exception { - syncCreateRoom(); - } - - public static void syncCreateRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - CreateRoomRequest request = - CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build(); - Room response = messagingClient.createRoom(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java deleted file mode 100644 index 7fcd4b7c45..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_StringString_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class SyncCreateRoomStringString { - - public static void main(String[] args) throws Exception { - syncCreateRoomStringString(); - } - - public static void syncCreateRoomStringString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - Room response = messagingClient.createRoom(displayName, description); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_StringString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java deleted file mode 100644 index 664a34bc76..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; - -public class AsyncDeleteBlurb { - - public static void main(String[] args) throws Exception { - asyncDeleteBlurb(); - } - - public static void asyncDeleteBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - DeleteBlurbRequest request = - DeleteBlurbRequest.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .build(); - ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java deleted file mode 100644 index cd93918820..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; - -public class SyncDeleteBlurb { - - public static void main(String[] args) throws Exception { - syncDeleteBlurb(); - } - - public static void syncDeleteBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - DeleteBlurbRequest request = - DeleteBlurbRequest.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .build(); - messagingClient.deleteBlurb(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java deleted file mode 100644 index 815c598962..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_Blurbname_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.MessagingClient; - -public class SyncDeleteBlurbBlurbname { - - public static void main(String[] args) throws Exception { - syncDeleteBlurbBlurbname(); - } - - public static void syncDeleteBlurbBlurbname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - messagingClient.deleteBlurb(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_Blurbname_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java deleted file mode 100644 index 30d35e96cb..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteBlurb_String_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.MessagingClient; - -public class SyncDeleteBlurbString { - - public static void main(String[] args) throws Exception { - syncDeleteBlurbString(); - } - - public static void syncDeleteBlurbString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String name = - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString(); - messagingClient.deleteBlurb(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteBlurb_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java deleted file mode 100644 index f521ea0ab6..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; - -public class AsyncDeleteRoom { - - public static void main(String[] args) throws Exception { - asyncDeleteRoom(); - } - - public static void asyncDeleteRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - DeleteRoomRequest request = - DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); - ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java deleted file mode 100644 index bcb643cbea..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; - -public class SyncDeleteRoom { - - public static void main(String[] args) throws Exception { - syncDeleteRoom(); - } - - public static void syncDeleteRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - DeleteRoomRequest request = - DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); - messagingClient.deleteRoom(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java deleted file mode 100644 index bed6bd6339..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_Roomname_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; - -public class SyncDeleteRoomRoomname { - - public static void main(String[] args) throws Exception { - syncDeleteRoomRoomname(); - } - - public static void syncDeleteRoomRoomname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName name = RoomName.of("[ROOM]"); - messagingClient.deleteRoom(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_Roomname_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java deleted file mode 100644 index c8ef55c8f0..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_DeleteRoom_String_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; - -public class SyncDeleteRoomString { - - public static void main(String[] args) throws Exception { - syncDeleteRoomString(); - } - - public static void syncDeleteRoomString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String name = RoomName.of("[ROOM]").toString(); - messagingClient.deleteRoom(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_DeleteRoom_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java deleted file mode 100644 index 3bcdc0dfa2..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; - -public class AsyncGetBlurb { - - public static void main(String[] args) throws Exception { - asyncGetBlurb(); - } - - public static void asyncGetBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - GetBlurbRequest request = - GetBlurbRequest.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .build(); - ApiFuture future = messagingClient.getBlurbCallable().futureCall(request); - // Do something. - Blurb response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java deleted file mode 100644 index 0ca916ecfb..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; - -public class SyncGetBlurb { - - public static void main(String[] args) throws Exception { - syncGetBlurb(); - } - - public static void syncGetBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - GetBlurbRequest request = - GetBlurbRequest.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .build(); - Blurb response = messagingClient.getBlurb(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java deleted file mode 100644 index 8288ba1002..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_Blurbname_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.MessagingClient; - -public class SyncGetBlurbBlurbname { - - public static void main(String[] args) throws Exception { - syncGetBlurbBlurbname(); - } - - public static void syncGetBlurbBlurbname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - Blurb response = messagingClient.getBlurb(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_Blurbname_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java deleted file mode 100644 index 3a7f190d7b..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetBlurb_String_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.BlurbName; -import com.google.showcase.v1beta1.MessagingClient; - -public class SyncGetBlurbString { - - public static void main(String[] args) throws Exception { - syncGetBlurbString(); - } - - public static void syncGetBlurbString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String name = - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString(); - Blurb response = messagingClient.getBlurb(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetBlurb_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java deleted file mode 100644 index 7449457aec..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetRoom_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.RoomName; - -public class AsyncGetRoom { - - public static void main(String[] args) throws Exception { - asyncGetRoom(); - } - - public static void asyncGetRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - GetRoomRequest request = - GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); - ApiFuture future = messagingClient.getRoomCallable().futureCall(request); - // Do something. - Room response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetRoom_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java deleted file mode 100644 index 50195f0808..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetRoom_sync] -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.RoomName; - -public class SyncGetRoom { - - public static void main(String[] args) throws Exception { - syncGetRoom(); - } - - public static void syncGetRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - GetRoomRequest request = - GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build(); - Room response = messagingClient.getRoom(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetRoom_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java deleted file mode 100644 index 330ff415e6..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetRoom_Roomname_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.RoomName; - -public class SyncGetRoomRoomname { - - public static void main(String[] args) throws Exception { - syncGetRoomRoomname(); - } - - public static void syncGetRoomRoomname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName name = RoomName.of("[ROOM]"); - Room response = messagingClient.getRoom(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetRoom_Roomname_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java deleted file mode 100644 index a0d1d29738..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_GetRoom_String_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.RoomName; - -public class SyncGetRoomString { - - public static void main(String[] args) throws Exception { - syncGetRoomString(); - } - - public static void syncGetRoomString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String name = RoomName.of("[ROOM]").toString(); - Room response = messagingClient.getRoom(name); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_GetRoom_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java deleted file mode 100644 index e1ed6b891e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class AsyncListBlurbs { - - public static void main(String[] args) throws Exception { - asyncListBlurbs(); - } - - public static void asyncListBlurbs() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request); - // Do something. - for (Blurb element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java deleted file mode 100644 index 4fe5854968..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class AsyncListBlurbsPaged { - - public static void main(String[] args) throws Exception { - asyncListBlurbsPaged(); - } - - public static void asyncListBlurbsPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request); - for (Blurb element : response.getBlurbsList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java deleted file mode 100644 index ad1fe7ca00..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class SyncListBlurbs { - - public static void main(String[] args) throws Exception { - syncListBlurbs(); - } - - public static void syncListBlurbs() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (Blurb element : messagingClient.listBlurbs(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java deleted file mode 100644 index cd576614b4..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_Profilename_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class SyncListBlurbsProfilename { - - public static void main(String[] args) throws Exception { - syncListBlurbsProfilename(); - } - - public static void syncListBlurbsProfilename() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ProfileName parent = ProfileName.of("[USER]"); - for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_Profilename_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java deleted file mode 100644 index e4e34b5327..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_Roomname_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; - -public class SyncListBlurbsRoomname { - - public static void main(String[] args) throws Exception { - syncListBlurbsRoomname(); - } - - public static void syncListBlurbsRoomname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName parent = RoomName.of("[ROOM]"); - for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_Roomname_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java deleted file mode 100644 index 77b1f2b68d..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListBlurbs_String_sync] -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; - -public class SyncListBlurbsString { - - public static void main(String[] args) throws Exception { - syncListBlurbsString(); - } - - public static void syncListBlurbsString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String parent = ProfileName.of("[USER]").toString(); - for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListBlurbs_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java deleted file mode 100644 index 245db794fc..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListRooms_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class AsyncListRooms { - - public static void main(String[] args) throws Exception { - asyncListRooms(); - } - - public static void asyncListRooms() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request); - // Do something. - for (Room element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListRooms_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java deleted file mode 100644 index faf33d3da5..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListRooms_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class AsyncListRoomsPaged { - - public static void main(String[] args) throws Exception { - asyncListRoomsPaged(); - } - - public static void asyncListRoomsPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListRoomsResponse response = messagingClient.listRoomsCallable().call(request); - for (Room element : response.getRoomsList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListRooms_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java deleted file mode 100644 index f8196f7e96..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_ListRooms_sync] -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class SyncListRooms { - - public static void main(String[] args) throws Exception { - syncListRooms(); - } - - public static void syncListRooms() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (Room element : messagingClient.listRooms(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_ListRooms_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java deleted file mode 100644 index f74d6da297..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_async] -import com.google.api.core.ApiFuture; -import com.google.longrunning.Operation; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SearchBlurbsRequest; - -public class AsyncSearchBlurbs { - - public static void main(String[] args) throws Exception { - asyncSearchBlurbs(); - } - - public static void asyncSearchBlurbs() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setQuery("query107944136") - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request); - // Do something. - Operation response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java deleted file mode 100644 index 70be85e24a..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_LRO_async] -import com.google.api.gax.longrunning.OperationFuture; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; - -public class AsyncSearchBlurbsLRO { - - public static void main(String[] args) throws Exception { - asyncSearchBlurbsLRO(); - } - - public static void asyncSearchBlurbsLRO() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setQuery("query107944136") - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - OperationFuture future = - messagingClient.searchBlurbsOperationCallable().futureCall(request); - // Do something. - SearchBlurbsResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_LRO_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java deleted file mode 100644 index 9185a19d58..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; - -public class SyncSearchBlurbs { - - public static void main(String[] args) throws Exception { - syncSearchBlurbs(); - } - - public static void syncSearchBlurbs() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setQuery("query107944136") - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(request).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java deleted file mode 100644 index 3601c897d4..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_ProfilenameString_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SearchBlurbsResponse; - -public class SyncSearchBlurbsProfilenameString { - - public static void main(String[] args) throws Exception { - syncSearchBlurbsProfilenameString(); - } - - public static void syncSearchBlurbsProfilenameString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_ProfilenameString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java deleted file mode 100644 index 164a2a0d52..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_RoomnameString_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.RoomName; -import com.google.showcase.v1beta1.SearchBlurbsResponse; - -public class SyncSearchBlurbsRoomnameString { - - public static void main(String[] args) throws Exception { - syncSearchBlurbsRoomnameString(); - } - - public static void syncSearchBlurbsRoomnameString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_RoomnameString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java deleted file mode 100644 index dffc4662fd..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_StringString_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SearchBlurbsResponse; - -public class SyncSearchBlurbsStringString { - - public static void main(String[] args) throws Exception { - syncSearchBlurbsStringString(); - } - - public static void syncSearchBlurbsStringString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - String parent = ProfileName.of("[USER]").toString(); - String query = "query107944136"; - SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_StringString_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java deleted file mode 100644 index 88c6d67af7..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SendBlurbs_async] -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SendBlurbsResponse; - -public class AsyncSendBlurbs { - - public static void main(String[] args) throws Exception { - asyncSendBlurbs(); - } - - public static void asyncSendBlurbs() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - ApiStreamObserver responseObserver = - new ApiStreamObserver() { - @Override - public void onNext(SendBlurbsResponse response) { - // Do something when a response is received. - } - - @Override - public void onError(Throwable t) { - // Add error-handling - } - - @Override - public void onCompleted() { - // Do something when complete. - } - }; - ApiStreamObserver requestObserver = - messagingClient.sendBlurbs().clientStreamingCall(responseObserver); - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - requestObserver.onNext(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SendBlurbs_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java deleted file mode 100644 index 22d85305d4..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_StreamBlurbs_async] -import com.google.api.gax.rpc.ServerStream; -import com.google.protobuf.Timestamp; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; - -public class AsyncStreamBlurbs { - - public static void main(String[] args) throws Exception { - asyncStreamBlurbs(); - } - - public static void asyncStreamBlurbs() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - StreamBlurbsRequest request = - StreamBlurbsRequest.newBuilder() - .setName(ProfileName.of("[USER]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .build(); - ServerStream stream = - messagingClient.streamBlurbsCallable().call(request); - for (StreamBlurbsResponse response : stream) { - // Do something when a response is received. - } - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_StreamBlurbs_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java deleted file mode 100644 index 5f26fbdccc..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_UpdateBlurb_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.FieldMask; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.UpdateBlurbRequest; - -public class AsyncUpdateBlurb { - - public static void main(String[] args) throws Exception { - asyncUpdateBlurb(); - } - - public static void asyncUpdateBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb(Blurb.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request); - // Do something. - Blurb response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_UpdateBlurb_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java deleted file mode 100644 index 415b326718..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_UpdateBlurb_sync] -import com.google.protobuf.FieldMask; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.UpdateBlurbRequest; - -public class SyncUpdateBlurb { - - public static void main(String[] args) throws Exception { - syncUpdateBlurb(); - } - - public static void syncUpdateBlurb() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb(Blurb.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - Blurb response = messagingClient.updateBlurb(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_UpdateBlurb_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java deleted file mode 100644 index 6e7b19ad5c..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_UpdateRoom_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.FieldMask; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.UpdateRoomRequest; - -public class AsyncUpdateRoom { - - public static void main(String[] args) throws Exception { - asyncUpdateRoom(); - } - - public static void asyncUpdateRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom(Room.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = messagingClient.updateRoomCallable().futureCall(request); - // Do something. - Room response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_UpdateRoom_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java deleted file mode 100644 index 915b84c12e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_UpdateRoom_sync] -import com.google.protobuf.FieldMask; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.UpdateRoomRequest; - -public class SyncUpdateRoom { - - public static void main(String[] args) throws Exception { - syncUpdateRoom(); - } - - public static void syncUpdateRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (MessagingClient messagingClient = MessagingClient.create()) { - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom(Room.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - Room response = messagingClient.updateRoom(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_UpdateRoom_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java deleted file mode 100644 index 2ab7cbe27e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] -import com.google.showcase.v1beta1.MessagingSettings; -import java.time.Duration; - -public class SyncCreateRoom { - - public static void main(String[] args) throws Exception { - syncCreateRoom(); - } - - public static void syncCreateRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder(); - messagingSettingsBuilder - .createRoomSettings() - .setRetrySettings( - messagingSettingsBuilder - .createRoomSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - MessagingSettings messagingSettings = messagingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java deleted file mode 100644 index b8cbd41577..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.SequenceName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class AsyncAttemptSequence { - - public static void main(String[] args) throws Exception { - asyncAttemptSequence(); - } - - public static void asyncAttemptSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - AttemptSequenceRequest request = - AttemptSequenceRequest.newBuilder() - .setName(SequenceName.of("[SEQUENCE]").toString()) - .build(); - ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java deleted file mode 100644 index 3d6637e455..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.SequenceName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncAttemptSequence { - - public static void main(String[] args) throws Exception { - syncAttemptSequence(); - } - - public static void syncAttemptSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - AttemptSequenceRequest request = - AttemptSequenceRequest.newBuilder() - .setName(SequenceName.of("[SEQUENCE]").toString()) - .build(); - sequenceServiceClient.attemptSequence(request); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java deleted file mode 100644 index 0e9a0ff985..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_Sequencename_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.SequenceName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncAttemptSequenceSequencename { - - public static void main(String[] args) throws Exception { - syncAttemptSequenceSequencename(); - } - - public static void syncAttemptSequenceSequencename() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - SequenceName name = SequenceName.of("[SEQUENCE]"); - sequenceServiceClient.attemptSequence(name); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_Sequencename_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java deleted file mode 100644 index cfc94a15c6..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_AttemptSequence_String_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.SequenceName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncAttemptSequenceString { - - public static void main(String[] args) throws Exception { - syncAttemptSequenceString(); - } - - public static void syncAttemptSequenceString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - String name = SequenceName.of("[SEQUENCE]").toString(); - sequenceServiceClient.attemptSequence(name); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_AttemptSequence_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index b1c0a96894..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.SequenceServiceClient; -import com.google.showcase.v1beta1.SequenceServiceSettings; -import com.google.showcase.v1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SequenceServiceSettings sequenceServiceSettings = - SequenceServiceSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - SequenceServiceClient sequenceServiceClient = - SequenceServiceClient.create(sequenceServiceSettings); - } -} -// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 5f6f2f63f8..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.SequenceServiceClient; -import com.google.showcase.v1beta1.SequenceServiceSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SequenceServiceSettings sequenceServiceSettings = - SequenceServiceSettings.newHttpJsonBuilder().build(); - SequenceServiceClient sequenceServiceClient = - SequenceServiceClient.create(sequenceServiceSettings); - } -} -// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider1_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 80d2a57c02..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.SequenceServiceClient; -import com.google.showcase.v1beta1.SequenceServiceSettings; -import com.google.showcase.v1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SequenceServiceSettings sequenceServiceSettings = - SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); - SequenceServiceClient sequenceServiceClient = - SequenceServiceClient.create(sequenceServiceSettings); - } -} -// [END localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java deleted file mode 100644 index 75bd7fdd4a..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class AsyncCreateSequence { - - public static void main(String[] args) throws Exception { - asyncCreateSequence(); - } - - public static void asyncCreateSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - CreateSequenceRequest request = - CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build(); - ApiFuture future = - sequenceServiceClient.createSequenceCallable().futureCall(request); - // Do something. - Sequence response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java deleted file mode 100644 index b798739218..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncCreateSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequence(); - } - - public static void syncCreateSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - CreateSequenceRequest request = - CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build(); - Sequence response = sequenceServiceClient.createSequence(request); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java deleted file mode 100644 index 857cf07c55..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_Sequence_sync] -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncCreateSequenceSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequenceSequence(); - } - - public static void syncCreateSequenceSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - Sequence sequence = Sequence.newBuilder().build(); - Sequence response = sequenceServiceClient.createSequence(sequence); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_Sequence_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java deleted file mode 100644 index 98e96691d7..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.SequenceReport; -import com.google.showcase.v1beta1.SequenceReportName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class AsyncGetSequenceReport { - - public static void main(String[] args) throws Exception { - asyncGetSequenceReport(); - } - - public static void asyncGetSequenceReport() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - GetSequenceReportRequest request = - GetSequenceReportRequest.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .build(); - ApiFuture future = - sequenceServiceClient.getSequenceReportCallable().futureCall(request); - // Do something. - SequenceReport response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java deleted file mode 100644 index 703ffb36fc..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_sync] -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.SequenceReport; -import com.google.showcase.v1beta1.SequenceReportName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncGetSequenceReport { - - public static void main(String[] args) throws Exception { - syncGetSequenceReport(); - } - - public static void syncGetSequenceReport() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - GetSequenceReportRequest request = - GetSequenceReportRequest.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .build(); - SequenceReport response = sequenceServiceClient.getSequenceReport(request); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java deleted file mode 100644 index d40653efc3..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_Sequencereportname_sync] -import com.google.showcase.v1beta1.SequenceReport; -import com.google.showcase.v1beta1.SequenceReportName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncGetSequenceReportSequencereportname { - - public static void main(String[] args) throws Exception { - syncGetSequenceReportSequencereportname(); - } - - public static void syncGetSequenceReportSequencereportname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - SequenceReport response = sequenceServiceClient.getSequenceReport(name); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_Sequencereportname_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java deleted file mode 100644 index f0ac090a1f..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_String_sync] -import com.google.showcase.v1beta1.SequenceReport; -import com.google.showcase.v1beta1.SequenceReportName; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncGetSequenceReportString { - - public static void main(String[] args) throws Exception { - syncGetSequenceReportString(); - } - - public static void syncGetSequenceReportString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - String name = SequenceReportName.of("[SEQUENCE]").toString(); - SequenceReport response = sequenceServiceClient.getSequenceReport(name); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_GetSequenceReport_String_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java deleted file mode 100644 index d225414159..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] -import com.google.showcase.v1beta1.SequenceServiceSettings; -import java.time.Duration; - -public class SyncCreateSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequence(); - } - - public static void syncCreateSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SequenceServiceSettings.Builder sequenceServiceSettingsBuilder = - SequenceServiceSettings.newBuilder(); - sequenceServiceSettingsBuilder - .createSequenceSettings() - .setRetrySettings( - sequenceServiceSettingsBuilder - .createSequenceSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java deleted file mode 100644 index c0b9e53a5b..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] -import com.google.showcase.v1beta1.stub.ComplianceStubSettings; -import java.time.Duration; - -public class SyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - syncRepeatDataBody(); - } - - public static void syncRepeatDataBody() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder(); - complianceSettingsBuilder - .repeatDataBodySettings() - .setRetrySettings( - complianceSettingsBuilder - .repeatDataBodySettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java deleted file mode 100644 index a7a18faf48..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] -import com.google.showcase.v1beta1.stub.EchoStubSettings; -import java.time.Duration; - -public class SyncEcho { - - public static void main(String[] args) throws Exception { - syncEcho(); - } - - public static void syncEcho() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); - echoSettingsBuilder - .echoSettings() - .setRetrySettings( - echoSettingsBuilder - .echoSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - EchoStubSettings echoSettings = echoSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java deleted file mode 100644 index 0413eb47cd..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] -import com.google.showcase.v1beta1.stub.IdentityStubSettings; -import java.time.Duration; - -public class SyncCreateUser { - - public static void main(String[] args) throws Exception { - syncCreateUser(); - } - - public static void syncCreateUser() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder(); - identitySettingsBuilder - .createUserSettings() - .setRetrySettings( - identitySettingsBuilder - .createUserSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - IdentityStubSettings identitySettings = identitySettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java deleted file mode 100644 index deffa23fc2..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] -import com.google.showcase.v1beta1.stub.MessagingStubSettings; -import java.time.Duration; - -public class SyncCreateRoom { - - public static void main(String[] args) throws Exception { - syncCreateRoom(); - } - - public static void syncCreateRoom() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder(); - messagingSettingsBuilder - .createRoomSettings() - .setRetrySettings( - messagingSettingsBuilder - .createRoomSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - MessagingStubSettings messagingSettings = messagingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java deleted file mode 100644 index c34917c717..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] -import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; -import java.time.Duration; - -public class SyncCreateSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequence(); - } - - public static void syncCreateSequence() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder = - SequenceServiceStubSettings.newBuilder(); - sequenceServiceSettingsBuilder - .createSequenceSettings() - .setRetrySettings( - sequenceServiceSettingsBuilder - .createSequenceSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java deleted file mode 100644 index 0bac2ef097..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] -import com.google.showcase.v1beta1.stub.TestingStubSettings; -import java.time.Duration; - -public class SyncCreateSession { - - public static void main(String[] args) throws Exception { - syncCreateSession(); - } - - public static void syncCreateSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder(); - testingSettingsBuilder - .createSessionSettings() - .setRetrySettings( - testingSettingsBuilder - .createSessionSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - TestingStubSettings testingSettings = testingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 54e8f745b6..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.TestingSettings; -import com.google.showcase.v1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - TestingSettings testingSettings = - TestingSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - TestingClient testingClient = TestingClient.create(testingSettings); - } -} -// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 98fb47f1f2..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.TestingSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build(); - TestingClient testingClient = TestingClient.create(testingSettings); - } -} -// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider1_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 31d2c2a00c..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.TestingSettings; -import com.google.showcase.v1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build(); - TestingClient testingClient = TestingClient.create(testingSettings); - } -} -// [END localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java deleted file mode 100644 index 6706d5fbbf..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_CreateSession_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncCreateSession { - - public static void main(String[] args) throws Exception { - asyncCreateSession(); - } - - public static void asyncCreateSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - ApiFuture future = testingClient.createSessionCallable().futureCall(request); - // Do something. - Session response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_CreateSession_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java deleted file mode 100644 index 1e155623d0..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_CreateSession_sync] -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncCreateSession { - - public static void main(String[] args) throws Exception { - syncCreateSession(); - } - - public static void syncCreateSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - Session response = testingClient.createSession(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_CreateSession_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java deleted file mode 100644 index 38d1dff284..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_DeleteSession_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncDeleteSession { - - public static void main(String[] args) throws Exception { - asyncDeleteSession(); - } - - public static void asyncDeleteSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - ApiFuture future = testingClient.deleteSessionCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_DeleteSession_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java deleted file mode 100644 index d8e1cfcefb..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_DeleteSession_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncDeleteSession { - - public static void main(String[] args) throws Exception { - syncDeleteSession(); - } - - public static void syncDeleteSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - testingClient.deleteSession(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_DeleteSession_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java deleted file mode 100644 index bbe7e7edc2..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_DeleteTest_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.TestName; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncDeleteTest { - - public static void main(String[] args) throws Exception { - asyncDeleteTest(); - } - - public static void asyncDeleteTest() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - ApiFuture future = testingClient.deleteTestCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_DeleteTest_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java deleted file mode 100644 index aa2ad11d74..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_DeleteTest_sync] -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.TestName; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncDeleteTest { - - public static void main(String[] args) throws Exception { - syncDeleteTest(); - } - - public static void syncDeleteTest() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - testingClient.deleteTest(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_DeleteTest_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java deleted file mode 100644 index f00a7a974b..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_GetSession_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncGetSession { - - public static void main(String[] args) throws Exception { - asyncGetSession(); - } - - public static void asyncGetSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - ApiFuture future = testingClient.getSessionCallable().futureCall(request); - // Do something. - Session response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_GetSession_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java deleted file mode 100644 index 3ed0205286..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_GetSession_sync] -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncGetSession { - - public static void main(String[] args) throws Exception { - syncGetSession(); - } - - public static void syncGetSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - Session response = testingClient.getSession(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_GetSession_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java deleted file mode 100644 index 416101c8d7..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ListSessions_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncListSessions { - - public static void main(String[] args) throws Exception { - asyncListSessions(); - } - - public static void asyncListSessions() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request); - // Do something. - for (Session element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ListSessions_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java deleted file mode 100644 index afc3931922..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ListSessions_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncListSessionsPaged { - - public static void main(String[] args) throws Exception { - asyncListSessionsPaged(); - } - - public static void asyncListSessionsPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListSessionsResponse response = testingClient.listSessionsCallable().call(request); - for (Session element : response.getSessionsList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ListSessions_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java deleted file mode 100644 index af3db7796e..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ListSessions_sync] -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncListSessions { - - public static void main(String[] args) throws Exception { - syncListSessions(); - } - - public static void syncListSessions() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (Session element : testingClient.listSessions(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ListSessions_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java deleted file mode 100644 index b32136cb50..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ListTests_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.Test; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncListTests { - - public static void main(String[] args) throws Exception { - asyncListTests(); - } - - public static void asyncListTests() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request); - // Do something. - for (Test element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ListTests_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java deleted file mode 100644 index 41692c2cdc..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ListTests_Paged_async] -import com.google.common.base.Strings; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.Test; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncListTestsPaged { - - public static void main(String[] args) throws Exception { - asyncListTestsPaged(); - } - - public static void asyncListTestsPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListTestsResponse response = testingClient.listTestsCallable().call(request); - for (Test element : response.getTestsList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ListTests_Paged_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java deleted file mode 100644 index 09e918bcbf..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ListTests_sync] -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.Test; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncListTests { - - public static void main(String[] args) throws Exception { - syncListTests(); - } - - public static void syncListTests() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (Test element : testingClient.listTests(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ListTests_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java deleted file mode 100644 index b049d290f1..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ReportSession_async] -import com.google.api.core.ApiFuture; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.TestingClient; - -public class AsyncReportSession { - - public static void main(String[] args) throws Exception { - asyncReportSession(); - } - - public static void asyncReportSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - ApiFuture future = - testingClient.reportSessionCallable().futureCall(request); - // Do something. - ReportSessionResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ReportSession_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java deleted file mode 100644 index 1420b6a569..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_ReportSession_sync] -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.SessionName; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncReportSession { - - public static void main(String[] args) throws Exception { - syncReportSession(); - } - - public static void syncReportSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - ReportSessionResponse response = testingClient.reportSession(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_ReportSession_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java deleted file mode 100644 index 1c6216b9ba..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_VerifyTest_async] -import com.google.api.core.ApiFuture; -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.TestName; -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import java.util.ArrayList; - -public class AsyncVerifyTest { - - public static void main(String[] args) throws Exception { - asyncVerifyTest(); - } - - public static void asyncVerifyTest() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - ApiFuture future = testingClient.verifyTestCallable().futureCall(request); - // Do something. - VerifyTestResponse response = future.get(); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_VerifyTest_async] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java deleted file mode 100644 index 26ed7c7d1a..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_VerifyTest_sync] -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.TestName; -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import java.util.ArrayList; - -public class SyncVerifyTest { - - public static void main(String[] args) throws Exception { - syncVerifyTest(); - } - - public static void syncVerifyTest() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (TestingClient testingClient = TestingClient.create()) { - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - VerifyTestResponse response = testingClient.verifyTest(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_VerifyTest_sync] diff --git a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java b/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java deleted file mode 100644 index 9fd60bceb9..0000000000 --- a/test/integration/goldens/showcase/samples/snippets/generated/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] -import com.google.showcase.v1beta1.TestingSettings; -import java.time.Duration; - -public class SyncCreateSession { - - public static void main(String[] args) throws Exception { - syncCreateSession(); - } - - public static void syncCreateSession() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder(); - testingSettingsBuilder - .createSessionSettings() - .setRetrySettings( - testingSettingsBuilder - .createSessionSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - TestingSettings testingSettings = testingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/BlurbName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/BlurbName.java deleted file mode 100644 index 32f3ed2380..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/BlurbName.java +++ /dev/null @@ -1,473 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.pathtemplate.ValidationException; -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 BlurbName implements ResourceName { - private static final PathTemplate USER_LEGACY_USER_BLURB = - PathTemplate.createWithoutUrlEncoding( - "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); - private static final PathTemplate USER_BLURB = - PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); - private static final PathTemplate ROOM_BLURB = - PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); - private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = - PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); - private volatile Map fieldValuesMap; - private PathTemplate pathTemplate; - private String fixedValue; - private final String user; - private final String legacyUser; - private final String blurb; - private final String room; - private final String legacyRoom; - - @Deprecated - protected BlurbName() { - user = null; - legacyUser = null; - blurb = null; - room = null; - legacyRoom = null; - } - - private BlurbName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - room = null; - legacyRoom = null; - pathTemplate = USER_LEGACY_USER_BLURB; - } - - private BlurbName(UserBlurbBuilder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - legacyUser = null; - room = null; - legacyRoom = null; - pathTemplate = USER_BLURB; - } - - private BlurbName(RoomBlurbBuilder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - user = null; - legacyUser = null; - legacyRoom = null; - pathTemplate = ROOM_BLURB; - } - - private BlurbName(RoomLegacyRoomBlurbBuilder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - user = null; - legacyUser = null; - pathTemplate = ROOM_LEGACY_ROOM_BLURB; - } - - public String getUser() { - return user; - } - - public String getLegacyUser() { - return legacyUser; - } - - public String getBlurb() { - return blurb; - } - - public String getRoom() { - return room; - } - - public String getLegacyRoom() { - return legacyRoom; - } - - public static Builder newBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static Builder newUserLegacyUserBlurbBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static UserBlurbBuilder newUserBlurbBuilder() { - return new UserBlurbBuilder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static RoomBlurbBuilder newRoomBlurbBuilder() { - return new RoomBlurbBuilder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { - return new RoomLegacyRoomBlurbBuilder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static BlurbName of(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofUserBlurbName(String user, String blurb) { - return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofRoomBlurbName(String room, String blurb) { - return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { - return newRoomLegacyRoomBlurbBuilder() - .setRoom(room) - .setLegacyRoom(legacyRoom) - .setBlurb(blurb) - .build(); - } - - public static String format(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatUserBlurbName(String user, String blurb) { - return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatRoomBlurbName(String room, String blurb) { - return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { - return newRoomLegacyRoomBlurbBuilder() - .setRoom(room) - .setLegacyRoom(legacyRoom) - .setBlurb(blurb) - .build() - .toString(); - } - - public static BlurbName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - if (USER_LEGACY_USER_BLURB.matches(formattedString)) { - Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); - return ofUserLegacyUserBlurbName( - matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); - } else if (USER_BLURB.matches(formattedString)) { - Map matchMap = USER_BLURB.match(formattedString); - return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); - } else if (ROOM_BLURB.matches(formattedString)) { - Map matchMap = ROOM_BLURB.match(formattedString); - return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); - } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { - Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); - return ofRoomLegacyRoomBlurbName( - matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); - } - throw new ValidationException("BlurbName.parse: formattedString not in valid format"); - } - - 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 (BlurbName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER_LEGACY_USER_BLURB.matches(formattedString) - || USER_BLURB.matches(formattedString) - || ROOM_BLURB.matches(formattedString) - || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - if (legacyUser != null) { - fieldMapBuilder.put("legacy_user", legacyUser); - } - if (blurb != null) { - fieldMapBuilder.put("blurb", blurb); - } - if (room != null) { - fieldMapBuilder.put("room", room); - } - if (legacyRoom != null) { - fieldMapBuilder.put("legacy_room", legacyRoom); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - BlurbName that = ((BlurbName) o); - return Objects.equals(this.user, that.user) - && Objects.equals(this.legacyUser, that.legacyUser) - && Objects.equals(this.blurb, that.blurb) - && Objects.equals(this.room, that.room) - && Objects.equals(this.legacyRoom, that.legacyRoom); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(user); - h *= 1000003; - h ^= Objects.hashCode(legacyUser); - h *= 1000003; - h ^= Objects.hashCode(blurb); - h *= 1000003; - h ^= Objects.hashCode(room); - h *= 1000003; - h ^= Objects.hashCode(legacyRoom); - return h; - } - - /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ - public static class Builder { - private String user; - private String legacyUser; - private String blurb; - - protected Builder() {} - - public String getUser() { - return user; - } - - public String getLegacyUser() { - return legacyUser; - } - - public String getBlurb() { - return blurb; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - public Builder setLegacyUser(String legacyUser) { - this.legacyUser = legacyUser; - return this; - } - - public Builder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - private Builder(BlurbName blurbName) { - Preconditions.checkArgument( - Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), - "toBuilder is only supported when BlurbName has the pattern of users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); - this.user = blurbName.user; - this.legacyUser = blurbName.legacyUser; - this.blurb = blurbName.blurb; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for users/{user}/profile/blurbs/{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class UserBlurbBuilder { - private String user; - private String blurb; - - protected UserBlurbBuilder() {} - - public String getUser() { - return user; - } - - public String getBlurb() { - return blurb; - } - - public UserBlurbBuilder setUser(String user) { - this.user = user; - return this; - } - - public UserBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for rooms/{room}/blurbs/{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class RoomBlurbBuilder { - private String room; - private String blurb; - - protected RoomBlurbBuilder() {} - - public String getRoom() { - return room; - } - - public String getBlurb() { - return blurb; - } - - public RoomBlurbBuilder setRoom(String room) { - this.room = room; - return this; - } - - public RoomBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class RoomLegacyRoomBlurbBuilder { - private String room; - private String legacyRoom; - private String blurb; - - protected RoomLegacyRoomBlurbBuilder() {} - - public String getRoom() { - return room; - } - - public String getLegacyRoom() { - return legacyRoom; - } - - public String getBlurb() { - return blurb; - } - - public RoomLegacyRoomBlurbBuilder setRoom(String room) { - this.room = room; - return this; - } - - public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { - this.legacyRoom = legacyRoom; - return this; - } - - public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClient.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClient.java deleted file mode 100644 index 266f562e23..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClient.java +++ /dev/null @@ -1,946 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.showcase.v1beta1.stub.ComplianceStub; -import com.google.showcase.v1beta1.stub.ComplianceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: This service is used to test that GAPICs implement various REST-related - * features correctly. This mostly means transcoding proto3 requests to REST format correctly for - * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums - * received by clients can be round-tripped correctly. - * - *

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (ComplianceClient complianceClient = ComplianceClient.create()) {
- *   RepeatRequest request =
- *       RepeatRequest.newBuilder()
- *           .setName("name3373707")
- *           .setInfo(ComplianceData.newBuilder().build())
- *           .setServerVerify(true)
- *           .setIntendedBindingUri("intendedBindingUri780142386")
- *           .setFInt32(-1143775883)
- *           .setFInt64(-1143775788)
- *           .setFDouble(-1239459382)
- *           .setPInt32(-858673665)
- *           .setPInt64(-858673570)
- *           .setPDouble(-991225216)
- *           .build();
- *   RepeatResponse response = complianceClient.repeatDataBody(request);
- * }
- * }
- * - *

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

To customize credentials: - * - *

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

To customize the endpoint: - * - *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class ComplianceClient implements BackgroundResource { - private final ComplianceSettings settings; - private final ComplianceStub stub; - - /** Constructs an instance of ComplianceClient with default settings. */ - public static final ComplianceClient create() throws IOException { - return create(ComplianceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of ComplianceClient, 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 ComplianceClient create(ComplianceSettings settings) throws IOException { - return new ComplianceClient(settings); - } - - /** - * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(ComplianceSettings). - */ - public static final ComplianceClient create(ComplianceStub stub) { - return new ComplianceClient(stub); - } - - /** - * Constructs an instance of ComplianceClient, 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 ComplianceClient(ComplianceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); - } - - protected ComplianceClient(ComplianceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final ComplianceSettings getSettings() { - return settings; - } - - public ComplianceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the entire request - * object in the REST body. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataBody(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 RepeatResponse repeatDataBody(RepeatRequest request) { - return repeatDataBodyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the entire request - * object in the REST body. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataBodyCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataBodyCallable() { - return stub.repeatDataBodyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the a message-type - * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataBodyInfo(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 RepeatResponse repeatDataBodyInfo(RepeatRequest request) { - return repeatDataBodyInfoCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the a message-type - * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataBodyInfoCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataBodyInfoCallable() { - return stub.repeatDataBodyInfoCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending all request fields - * as query parameters. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataQuery(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 RepeatResponse repeatDataQuery(RepeatRequest request) { - return repeatDataQueryCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending all request fields - * as query parameters. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataQueryCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataQueryCallable() { - return stub.repeatDataQueryCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending some parameters as - * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and - * the rest as query parameters. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataSimplePath(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 RepeatResponse repeatDataSimplePath(RepeatRequest request) { - return repeatDataSimplePathCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending some parameters as - * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and - * the rest as query parameters. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataSimplePathCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataSimplePathCallable() { - return stub.repeatDataSimplePathCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a path resource. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataPathResource(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 RepeatResponse repeatDataPathResource(RepeatRequest request) { - return repeatDataPathResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a path resource. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataPathResourceCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataPathResourceCallable() { - return stub.repeatDataPathResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a trailing resource. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataPathTrailingResource(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 RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { - return repeatDataPathTrailingResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a trailing resource. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - repeatDataPathTrailingResourceCallable() { - return stub.repeatDataPathTrailingResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PUT method. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataBodyPut(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 RepeatResponse repeatDataBodyPut(RepeatRequest request) { - return repeatDataBodyPutCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PUT method. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataBodyPutCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataBodyPutCallable() { - return stub.repeatDataBodyPutCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PATCH method. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   RepeatResponse response = complianceClient.repeatDataBodyPatch(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 RepeatResponse repeatDataBodyPatch(RepeatRequest request) { - return repeatDataBodyPatchCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PATCH method. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   RepeatRequest request =
-   *       RepeatRequest.newBuilder()
-   *           .setName("name3373707")
-   *           .setInfo(ComplianceData.newBuilder().build())
-   *           .setServerVerify(true)
-   *           .setIntendedBindingUri("intendedBindingUri780142386")
-   *           .setFInt32(-1143775883)
-   *           .setFInt64(-1143775788)
-   *           .setFDouble(-1239459382)
-   *           .setPInt32(-858673665)
-   *           .setPInt64(-858673570)
-   *           .setPDouble(-991225216)
-   *           .build();
-   *   ApiFuture future =
-   *       complianceClient.repeatDataBodyPatchCallable().futureCall(request);
-   *   // Do something.
-   *   RepeatResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable repeatDataBodyPatchCallable() { - return stub.repeatDataBodyPatchCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method requests an enum value from the server. Depending on the contents of EnumRequest, - * the enum value returned will be a known enum declared in the .proto file, or a made-up enum - * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues - * they receive, use the response from this RPC as the request to VerifyEnum() - * - *

The values of enums sent by the server when a known or unknown value is requested will be - * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are - * not guaranteed to be the same across separate Showcase server runs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
-   *   EnumResponse response = complianceClient.getEnum(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 EnumResponse getEnum(EnumRequest request) { - return getEnumCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method requests an enum value from the server. Depending on the contents of EnumRequest, - * the enum value returned will be a known enum declared in the .proto file, or a made-up enum - * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues - * they receive, use the response from this RPC as the request to VerifyEnum() - * - *

The values of enums sent by the server when a known or unknown value is requested will be - * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are - * not guaranteed to be the same across separate Showcase server runs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
-   *   ApiFuture future = complianceClient.getEnumCallable().futureCall(request);
-   *   // Do something.
-   *   EnumResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getEnumCallable() { - return stub.getEnumCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method is used to verify that clients can round-trip enum values, which is particularly - * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is - * presumably the response that the client previously got to a GetEnum(), contains the correct - * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. - * - *

This works because the values of enums sent by the server when a known or unknown value is - * requested will be the same within a single Showcase server run, although they are not - * guaranteed to be the same across separate Showcase server runs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   EnumResponse request =
-   *       EnumResponse.newBuilder()
-   *           .setRequest(EnumRequest.newBuilder().build())
-   *           .setContinent(Continent.forNumber(0))
-   *           .build();
-   *   EnumResponse response = complianceClient.verifyEnum(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 EnumResponse verifyEnum(EnumResponse request) { - return verifyEnumCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method is used to verify that clients can round-trip enum values, which is particularly - * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is - * presumably the response that the client previously got to a GetEnum(), contains the correct - * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. - * - *

This works because the values of enums sent by the server when a known or unknown value is - * requested will be the same within a single Showcase server run, although they are not - * guaranteed to be the same across separate Showcase server runs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
-   *   EnumResponse request =
-   *       EnumResponse.newBuilder()
-   *           .setRequest(EnumRequest.newBuilder().build())
-   *           .setContinent(Continent.forNumber(0))
-   *           .build();
-   *   ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request);
-   *   // Do something.
-   *   EnumResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable verifyEnumCallable() { - return stub.verifyEnumCallable(); - } - - @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); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java deleted file mode 100644 index e2498246af..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; -import java.io.IOException; -import java.util.List; -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 ComplianceClientHttpJsonTest { - private static MockHttpService mockService; - private static ComplianceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonComplianceStub.getMethodDescriptors(), ComplianceSettings.getDefaultEndpoint()); - ComplianceSettings settings = - ComplianceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - ComplianceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = ComplianceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void repeatDataBodyTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBody(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBody(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyInfoTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyInfo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyInfoExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyInfo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataQueryTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataQuery(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataQueryExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataQuery(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataSimplePathTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("fString-9139") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild(ComplianceDataChild.newBuilder().build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataSimplePath(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataSimplePathExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("fString-9139") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild(ComplianceDataChild.newBuilder().build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataSimplePath(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-5446") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataPathResourceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-5446") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathTrailingResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-3276") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataPathTrailingResourceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-3276") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathTrailingResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPutTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPut(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyPutExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPut(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPatchTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPatch(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyPatchExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPatch(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockService.addResponse(expectedResponse); - - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - - EnumResponse actualResponse = client.getEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getEnumExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - client.getEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockService.addResponse(expectedResponse); - - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - - EnumResponse actualResponse = client.verifyEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void verifyEnumExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - client.verifyEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientTest.java deleted file mode 100644 index 219b1c3712..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceClientTest.java +++ /dev/null @@ -1,740 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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.protobuf.AbstractMessage; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class ComplianceClientTest { - private static MockCompliance mockCompliance; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private ComplianceClient client; - - @BeforeClass - public static void startStaticServer() { - mockCompliance = new MockCompliance(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockCompliance)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - ComplianceSettings settings = - ComplianceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = ComplianceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void repeatDataBodyTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBody(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBody(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyInfoTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyInfo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyInfoExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyInfo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataQueryTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataQuery(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataQueryExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataQuery(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataSimplePathTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataSimplePath(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataSimplePathExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataSimplePath(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataPathResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathTrailingResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataPathTrailingResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathTrailingResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPutTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPut(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyPutExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPut(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPatchTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPatch(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyPatchExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPatch(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockCompliance.addResponse(expectedResponse); - - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - - EnumResponse actualResponse = client.getEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - EnumRequest actualRequest = ((EnumRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getUnknownEnum(), actualRequest.getUnknownEnum()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getEnumExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - client.getEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockCompliance.addResponse(expectedResponse); - - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - - EnumResponse actualResponse = client.verifyEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - EnumResponse actualRequest = ((EnumResponse) actualRequests.get(0)); - - Assert.assertEquals(request.getRequest(), actualRequest.getRequest()); - Assert.assertEquals(request.getContinent(), actualRequest.getContinent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void verifyEnumExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - client.verifyEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceSettings.java deleted file mode 100644 index 8b562e3999..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ComplianceSettings.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.showcase.v1beta1.stub.ComplianceStubSettings; -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 ComplianceClient}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 repeatDataBody to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder();
- * complianceSettingsBuilder
- *     .repeatDataBodySettings()
- *     .setRetrySettings(
- *         complianceSettingsBuilder
- *             .repeatDataBodySettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class ComplianceSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to repeatDataBody. */ - public UnaryCallSettings repeatDataBodySettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodySettings(); - } - - /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings repeatDataBodyInfoSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyInfoSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings repeatDataQuerySettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataQuerySettings(); - } - - /** Returns the object with the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings repeatDataSimplePathSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataSimplePathSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings repeatDataPathResourceSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataPathResourceSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings repeatDataPathTrailingResourceSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataPathTrailingResourceSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings repeatDataBodyPutSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPutSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings repeatDataBodyPatchSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPatchSettings(); - } - - /** Returns the object with the settings used for calls to getEnum. */ - public UnaryCallSettings getEnumSettings() { - return ((ComplianceStubSettings) getStubSettings()).getEnumSettings(); - } - - /** Returns the object with the settings used for calls to verifyEnum. */ - public UnaryCallSettings verifyEnumSettings() { - return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); - } - - public static final ComplianceSettings create(ComplianceStubSettings stub) throws IOException { - return new ComplianceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return ComplianceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return ComplianceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return ComplianceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return ComplianceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return ComplianceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return ComplianceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return ComplianceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected ComplianceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for ComplianceSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(ComplianceStubSettings.newBuilder(clientContext)); - } - - protected Builder(ComplianceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(ComplianceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(ComplianceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(ComplianceStubSettings.newHttpJsonBuilder()); - } - - public ComplianceStubSettings.Builder getStubSettingsBuilder() { - return ((ComplianceStubSettings.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 repeatDataBody. */ - public UnaryCallSettings.Builder repeatDataBodySettings() { - return getStubSettingsBuilder().repeatDataBodySettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { - return getStubSettingsBuilder().repeatDataBodyInfoSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings.Builder repeatDataQuerySettings() { - return getStubSettingsBuilder().repeatDataQuerySettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings.Builder repeatDataSimplePathSettings() { - return getStubSettingsBuilder().repeatDataSimplePathSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings.Builder - repeatDataPathResourceSettings() { - return getStubSettingsBuilder().repeatDataPathResourceSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings.Builder - repeatDataPathTrailingResourceSettings() { - return getStubSettingsBuilder().repeatDataPathTrailingResourceSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings.Builder repeatDataBodyPutSettings() { - return getStubSettingsBuilder().repeatDataBodyPutSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { - return getStubSettingsBuilder().repeatDataBodyPatchSettings(); - } - - /** Returns the builder for the settings used for calls to getEnum. */ - public UnaryCallSettings.Builder getEnumSettings() { - return getStubSettingsBuilder().getEnumSettings(); - } - - /** Returns the builder for the settings used for calls to verifyEnum. */ - public UnaryCallSettings.Builder verifyEnumSettings() { - return getStubSettingsBuilder().verifyEnumSettings(); - } - - @Override - public ComplianceSettings build() throws IOException { - return new ComplianceSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClient.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClient.java deleted file mode 100644 index 43d886930d..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClient.java +++ /dev/null @@ -1,999 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.httpjson.longrunning.OperationsClient; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.longrunning.Operation; -import com.google.showcase.v1beta1.stub.EchoStub; -import com.google.showcase.v1beta1.stub.EchoStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: This service is used showcase the four main types of rpcs - unary, server - * side streaming, client side streaming, and bidirectional streaming. This service also exposes - * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' - * metadata key on any method to have the values echoed in the response trailers. Set the - * 'x-goog-request-params' metadata key on any method to have the values echoed in the response - * headers. - * - *

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (EchoClient echoClient = EchoClient.create()) {
- *   EchoRequest request =
- *       EchoRequest.newBuilder()
- *           .setSeverity(Severity.forNumber(0))
- *           .setHeader("header-1221270899")
- *           .setOtherHeader("otherHeader-2026585667")
- *           .build();
- *   EchoResponse response = echoClient.echo(request);
- * }
- * }
- * - *

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

To customize credentials: - * - *

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

To customize the endpoint: - * - *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoClient implements BackgroundResource { - private final EchoSettings settings; - private final EchoStub stub; - private final OperationsClient httpJsonOperationsClient; - private final com.google.longrunning.OperationsClient operationsClient; - - /** Constructs an instance of EchoClient with default settings. */ - public static final EchoClient create() throws IOException { - return create(EchoSettings.newBuilder().build()); - } - - /** - * Constructs an instance of EchoClient, 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 EchoClient create(EchoSettings settings) throws IOException { - return new EchoClient(settings); - } - - /** - * Constructs an instance of EchoClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(EchoSettings). - */ - public static final EchoClient create(EchoStub stub) { - return new EchoClient(stub); - } - - /** - * Constructs an instance of EchoClient, 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 EchoClient(EchoSettings settings) throws IOException { - this.settings = settings; - this.stub = ((EchoStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - protected EchoClient(EchoStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - public final EchoSettings getSettings() { - return settings; - } - - public EchoStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - public final com.google.longrunning.OperationsClient getOperationsClient() { - return operationsClient; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi - public final OperationsClient getHttpJsonOperationsClient() { - return httpJsonOperationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method simply echoes the request. This method showcases unary RPCs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   EchoRequest request =
-   *       EchoRequest.newBuilder()
-   *           .setSeverity(Severity.forNumber(0))
-   *           .setHeader("header-1221270899")
-   *           .setOtherHeader("otherHeader-2026585667")
-   *           .build();
-   *   EchoResponse response = echoClient.echo(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 EchoResponse echo(EchoRequest request) { - return echoCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method simply echoes the request. This method showcases unary RPCs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   EchoRequest request =
-   *       EchoRequest.newBuilder()
-   *           .setSeverity(Severity.forNumber(0))
-   *           .setHeader("header-1221270899")
-   *           .setOtherHeader("otherHeader-2026585667")
-   *           .build();
-   *   ApiFuture future = echoClient.echoCallable().futureCall(request);
-   *   // Do something.
-   *   EchoResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable echoCallable() { - return stub.echoCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method splits the given content into words and will pass each word back through the - * stream. This method showcases server-side streaming RPCs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   ExpandRequest request =
-   *       ExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setError(Status.newBuilder().build())
-   *           .build();
-   *   ServerStream stream = echoClient.expandCallable().call(request);
-   *   for (EchoResponse response : stream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final ServerStreamingCallable expandCallable() { - return stub.expandCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will collect the words given to it. When the stream is closed by the client, this - * method will return the a concatenation of the strings passed to it. This method showcases - * client-side streaming RPCs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   ApiStreamObserver responseObserver =
-   *       new ApiStreamObserver() {
-   *         {@literal @}Override
-   *         public void onNext(EchoResponse response) {
-   *           // Do something when a response is received.
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver requestObserver =
-   *       echoClient.collect().clientStreamingCall(responseObserver);
-   *   EchoRequest request =
-   *       EchoRequest.newBuilder()
-   *           .setSeverity(Severity.forNumber(0))
-   *           .setHeader("header-1221270899")
-   *           .setOtherHeader("otherHeader-2026585667")
-   *           .build();
-   *   requestObserver.onNext(request);
-   * }
-   * }
- */ - public final ClientStreamingCallable collectCallable() { - return stub.collectCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method, upon receiving a request on the stream, will pass the same content back on the - * stream. This method showcases bidirectional streaming RPCs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   BidiStream bidiStream = echoClient.chatCallable().call();
-   *   EchoRequest request =
-   *       EchoRequest.newBuilder()
-   *           .setSeverity(Severity.forNumber(0))
-   *           .setHeader("header-1221270899")
-   *           .setOtherHeader("otherHeader-2026585667")
-   *           .build();
-   *   bidiStream.send(request);
-   *   for (EchoResponse response : bidiStream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final BidiStreamingCallable chatCallable() { - return stub.chatCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the Expand method but instead of returning a stream of expanded words, this - * method returns a paged list of expanded words. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandRequest request =
-   *       PagedExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (EchoResponse element : echoClient.pagedExpand(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 PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) { - return pagedExpandPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the Expand method but instead of returning a stream of expanded words, this - * method returns a paged list of expanded words. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandRequest request =
-   *       PagedExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (EchoResponse element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - pagedExpandPagedCallable() { - return stub.pagedExpandPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the Expand method but instead of returning a stream of expanded words, this - * method returns a paged list of expanded words. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandRequest request =
-   *       PagedExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
-   *     for (EchoResponse element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable pagedExpandCallable() { - return stub.pagedExpandCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the PagedExpand except that it uses max_results instead of page_size, as - * some legacy APIs still do. New APIs should NOT use this pattern. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandLegacyRequest request =
-   *       PagedExpandLegacyRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setMaxResults(1128457243)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { - return pagedExpandLegacyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the PagedExpand except that it uses max_results instead of page_size, as - * some legacy APIs still do. New APIs should NOT use this pattern. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandLegacyRequest request =
-   *       PagedExpandLegacyRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setMaxResults(1128457243)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
-   *   // Do something.
-   *   PagedExpandResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - pagedExpandLegacyCallable() { - return stub.pagedExpandLegacyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method returns a map containing lists of words that appear in the input, keyed by their - * initial character. The only words returned are the ones included in the current page, as - * determined by page_token and page_size, which both refer to the word indices in the input. This - * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs - * should NOT use this pattern. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandRequest request =
-   *       PagedExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Map.Entry element :
-   *       echoClient.pagedExpandLegacyMapped(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 PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped( - PagedExpandRequest request) { - return pagedExpandLegacyMappedPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method returns a map containing lists of words that appear in the input, keyed by their - * initial character. The only words returned are the ones included in the current page, as - * determined by page_token and page_size, which both refer to the word indices in the input. This - * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs - * should NOT use this pattern. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandRequest request =
-   *       PagedExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture> future =
-   *       echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Map.Entry element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - return stub.pagedExpandLegacyMappedPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method returns a map containing lists of words that appear in the input, keyed by their - * initial character. The only words returned are the ones included in the current page, as - * determined by page_token and page_size, which both refer to the word indices in the input. This - * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs - * should NOT use this pattern. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   PagedExpandRequest request =
-   *       PagedExpandRequest.newBuilder()
-   *           .setContent("content951530617")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     PagedExpandLegacyMappedResponse response =
-   *         echoClient.pagedExpandLegacyMappedCallable().call(request);
-   *     for (Map.Entry element : response.getAlphabetizedList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - pagedExpandLegacyMappedCallable() { - return stub.pagedExpandLegacyMappedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will wait for the requested amount of time and then return. This method showcases - * how a client handles a request timeout. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   WaitRequest request = WaitRequest.newBuilder().build();
-   *   WaitResponse response = echoClient.waitAsync(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 waitAsync(WaitRequest request) { - return waitOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will wait for the requested amount of time and then return. This method showcases - * how a client handles a request timeout. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   WaitRequest request = WaitRequest.newBuilder().build();
-   *   OperationFuture future =
-   *       echoClient.waitOperationCallable().futureCall(request);
-   *   // Do something.
-   *   WaitResponse response = future.get();
-   * }
-   * }
- */ - public final OperationCallable waitOperationCallable() { - return stub.waitOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will wait for the requested amount of time and then return. This method showcases - * how a client handles a request timeout. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   WaitRequest request = WaitRequest.newBuilder().build();
-   *   ApiFuture future = echoClient.waitCallable().futureCall(request);
-   *   // Do something.
-   *   Operation response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable waitCallable() { - return stub.waitCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will block (wait) for the requested amount of time and then return the response or - * error. This method showcases how a client handles delays or retries. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   BlockRequest request =
-   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
-   *   BlockResponse response = echoClient.block(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 BlockResponse block(BlockRequest request) { - return blockCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will block (wait) for the requested amount of time and then return the response or - * error. This method showcases how a client handles delays or retries. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (EchoClient echoClient = EchoClient.create()) {
-   *   BlockRequest request =
-   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
-   *   ApiFuture future = echoClient.blockCallable().futureCall(request);
-   *   // Do something.
-   *   BlockResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable blockCallable() { - return stub.blockCallable(); - } - - @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 PagedExpandPagedResponse - extends AbstractPagedListResponse< - PagedExpandRequest, - PagedExpandResponse, - EchoResponse, - PagedExpandPage, - PagedExpandFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - PagedExpandPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new PagedExpandPagedResponse(input), MoreExecutors.directExecutor()); - } - - private PagedExpandPagedResponse(PagedExpandPage page) { - super(page, PagedExpandFixedSizeCollection.createEmptyCollection()); - } - } - - public static class PagedExpandPage - extends AbstractPage { - - private PagedExpandPage( - PageContext context, - PagedExpandResponse response) { - super(context, response); - } - - private static PagedExpandPage createEmptyPage() { - return new PagedExpandPage(null, null); - } - - @Override - protected PagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { - return new PagedExpandPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class PagedExpandFixedSizeCollection - extends AbstractFixedSizeCollection< - PagedExpandRequest, - PagedExpandResponse, - EchoResponse, - PagedExpandPage, - PagedExpandFixedSizeCollection> { - - private PagedExpandFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static PagedExpandFixedSizeCollection createEmptyCollection() { - return new PagedExpandFixedSizeCollection(null, 0); - } - - @Override - protected PagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new PagedExpandFixedSizeCollection(pages, collectionSize); - } - } - - public static class PagedExpandLegacyMappedPagedResponse - extends AbstractPagedListResponse< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry, - PagedExpandLegacyMappedPage, - PagedExpandLegacyMappedFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - ApiFuture futureResponse) { - ApiFuture futurePage = - PagedExpandLegacyMappedPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new PagedExpandLegacyMappedPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private PagedExpandLegacyMappedPagedResponse(PagedExpandLegacyMappedPage page) { - super(page, PagedExpandLegacyMappedFixedSizeCollection.createEmptyCollection()); - } - } - - public static class PagedExpandLegacyMappedPage - extends AbstractPage< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry, - PagedExpandLegacyMappedPage> { - - private PagedExpandLegacyMappedPage( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - PagedExpandLegacyMappedResponse response) { - super(context, response); - } - - private static PagedExpandLegacyMappedPage createEmptyPage() { - return new PagedExpandLegacyMappedPage(null, null); - } - - @Override - protected PagedExpandLegacyMappedPage createPage( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - PagedExpandLegacyMappedResponse response) { - return new PagedExpandLegacyMappedPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class PagedExpandLegacyMappedFixedSizeCollection - extends AbstractFixedSizeCollection< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry, - PagedExpandLegacyMappedPage, - PagedExpandLegacyMappedFixedSizeCollection> { - - private PagedExpandLegacyMappedFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection() { - return new PagedExpandLegacyMappedFixedSizeCollection(null, 0); - } - - @Override - protected PagedExpandLegacyMappedFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java deleted file mode 100644 index c3084bda5f..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.showcase.v1beta1.stub.HttpJsonEchoStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -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 EchoClientHttpJsonTest { - private static MockHttpService mockService; - private static EchoClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonEchoStub.getMethodDescriptors(), EchoSettings.getDefaultEndpoint()); - EchoSettings settings = - EchoSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - EchoSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = EchoClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void echoTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockService.addResponse(expectedResponse); - - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - EchoResponse actualResponse = client.echo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void echoExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - client.echo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void expandTest() throws Exception {} - - @Test - public void expandExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - } - - @Test - public void collectUnsupportedMethodTest() throws Exception { - // The collect() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void chatUnsupportedMethodTest() throws Exception { - // The chat() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void pagedExpandTest() throws Exception { - EchoResponse responsesElement = EchoResponse.newBuilder().build(); - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .setNextPageToken("") - .addAllResponses(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pagedExpandExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpand(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyTest() throws Exception { - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .addAllResponses(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - mockService.addResponse(expectedResponse); - - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pagedExpandLegacyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyMappedTest() throws Exception { - PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); - PagedExpandLegacyMappedResponse expectedResponse = - PagedExpandLegacyMappedResponse.newBuilder() - .setNextPageToken("") - .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandLegacyMappedPagedResponse pagedListResponse = - client.pagedExpandLegacyMapped(request); - - List> resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals( - expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pagedExpandLegacyMappedExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacyMapped(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void waitTest() throws Exception { - WaitResponse expectedResponse = - WaitResponse.newBuilder().setContent("content951530617").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("waitTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - WaitRequest request = WaitRequest.newBuilder().build(); - - WaitResponse actualResponse = client.waitAsync(request).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void waitExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - WaitRequest request = WaitRequest.newBuilder().build(); - client.waitAsync(request).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void blockTest() throws Exception { - BlockResponse expectedResponse = - BlockResponse.newBuilder().setContent("content951530617").build(); - mockService.addResponse(expectedResponse); - - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - - BlockResponse actualResponse = client.block(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void blockExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - client.block(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientTest.java deleted file mode 100644 index 9f6f7f128c..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoClientTest.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -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.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.rpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -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 EchoClientTest { - private static MockEcho mockEcho; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private EchoClient client; - - @BeforeClass - public static void startStaticServer() { - mockEcho = new MockEcho(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockEcho)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - EchoSettings settings = - EchoSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = EchoClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void echoTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - EchoResponse actualResponse = client.echo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - EchoRequest actualRequest = ((EchoRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getError(), actualRequest.getError()); - Assert.assertEquals(request.getSeverity(), actualRequest.getSeverity()); - Assert.assertEquals(request.getHeader(), actualRequest.getHeader()); - Assert.assertEquals(request.getOtherHeader(), actualRequest.getOtherHeader()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void echoExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - client.echo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void expandTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - ExpandRequest request = - ExpandRequest.newBuilder() - .setContent("content951530617") - .setError(Status.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = client.expandCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void expandExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - ExpandRequest request = - ExpandRequest.newBuilder() - .setContent("content951530617") - .setError(Status.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = client.expandCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void collectTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = client.collectCallable(); - ApiStreamObserver requestObserver = callable.clientStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void collectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = client.collectCallable(); - ApiStreamObserver requestObserver = callable.clientStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void chatTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.chatCallable(); - ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void chatExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.chatCallable(); - ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void pagedExpandTest() throws Exception { - EchoResponse responsesElement = EchoResponse.newBuilder().build(); - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .setNextPageToken("") - .addAllResponses(Arrays.asList(responsesElement)) - .build(); - mockEcho.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pagedExpandExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpand(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyTest() throws Exception { - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .addAllResponses(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - mockEcho.addResponse(expectedResponse); - - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pagedExpandLegacyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyMappedTest() throws Exception { - PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); - PagedExpandLegacyMappedResponse expectedResponse = - PagedExpandLegacyMappedResponse.newBuilder() - .setNextPageToken("") - .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) - .build(); - mockEcho.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandLegacyMappedPagedResponse pagedListResponse = - client.pagedExpandLegacyMapped(request); - - List> resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals( - expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pagedExpandLegacyMappedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacyMapped(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void waitTest() throws Exception { - WaitResponse expectedResponse = - WaitResponse.newBuilder().setContent("content951530617").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("waitTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockEcho.addResponse(resultOperation); - - WaitRequest request = WaitRequest.newBuilder().build(); - - WaitResponse actualResponse = client.waitAsync(request).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - WaitRequest actualRequest = ((WaitRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getEndTime(), actualRequest.getEndTime()); - Assert.assertEquals(request.getTtl(), actualRequest.getTtl()); - Assert.assertEquals(request.getError(), actualRequest.getError()); - Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void waitExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - WaitRequest request = WaitRequest.newBuilder().build(); - client.waitAsync(request).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void blockTest() throws Exception { - BlockResponse expectedResponse = - BlockResponse.newBuilder().setContent("content951530617").build(); - mockEcho.addResponse(expectedResponse); - - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - - BlockResponse actualResponse = client.block(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - BlockRequest actualRequest = ((BlockRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResponseDelay(), actualRequest.getResponseDelay()); - Assert.assertEquals(request.getError(), actualRequest.getError()); - Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void blockExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - client.block(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoSettings.java deleted file mode 100644 index b8c1785ef0..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/EchoSettings.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.longrunning.Operation; -import com.google.showcase.v1beta1.stub.EchoStubSettings; -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 EchoClient}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 echo to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
- * echoSettingsBuilder
- *     .echoSettings()
- *     .setRetrySettings(
- *         echoSettingsBuilder
- *             .echoSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * EchoSettings echoSettings = echoSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to echo. */ - public UnaryCallSettings echoSettings() { - return ((EchoStubSettings) getStubSettings()).echoSettings(); - } - - /** Returns the object with the settings used for calls to expand. */ - public ServerStreamingCallSettings expandSettings() { - return ((EchoStubSettings) getStubSettings()).expandSettings(); - } - - /** Returns the object with the settings used for calls to collect. */ - public StreamingCallSettings collectSettings() { - return ((EchoStubSettings) getStubSettings()).collectSettings(); - } - - /** Returns the object with the settings used for calls to chat. */ - public StreamingCallSettings chatSettings() { - return ((EchoStubSettings) getStubSettings()).chatSettings(); - } - - /** Returns the object with the settings used for calls to pagedExpand. */ - public PagedCallSettings - pagedExpandSettings() { - return ((EchoStubSettings) getStubSettings()).pagedExpandSettings(); - } - - /** Returns the object with the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings - pagedExpandLegacySettings() { - return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); - } - - /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return ((EchoStubSettings) getStubSettings()).pagedExpandLegacyMappedSettings(); - } - - /** Returns the object with the settings used for calls to wait. */ - public UnaryCallSettings waitSettings() { - return ((EchoStubSettings) getStubSettings()).waitSettings(); - } - - /** Returns the object with the settings used for calls to wait. */ - public OperationCallSettings waitOperationSettings() { - return ((EchoStubSettings) getStubSettings()).waitOperationSettings(); - } - - /** Returns the object with the settings used for calls to block. */ - public UnaryCallSettings blockSettings() { - return ((EchoStubSettings) getStubSettings()).blockSettings(); - } - - public static final EchoSettings create(EchoStubSettings stub) throws IOException { - return new EchoSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return EchoStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return EchoStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return EchoStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return EchoStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return EchoStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return EchoStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return EchoStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected EchoSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for EchoSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(EchoStubSettings.newBuilder(clientContext)); - } - - protected Builder(EchoSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(EchoStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(EchoStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(EchoStubSettings.newHttpJsonBuilder()); - } - - public EchoStubSettings.Builder getStubSettingsBuilder() { - return ((EchoStubSettings.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 echo. */ - public UnaryCallSettings.Builder echoSettings() { - return getStubSettingsBuilder().echoSettings(); - } - - /** Returns the builder for the settings used for calls to expand. */ - public ServerStreamingCallSettings.Builder expandSettings() { - return getStubSettingsBuilder().expandSettings(); - } - - /** Returns the builder for the settings used for calls to collect. */ - public StreamingCallSettings.Builder collectSettings() { - return getStubSettingsBuilder().collectSettings(); - } - - /** Returns the builder for the settings used for calls to chat. */ - public StreamingCallSettings.Builder chatSettings() { - return getStubSettingsBuilder().chatSettings(); - } - - /** Returns the builder for the settings used for calls to pagedExpand. */ - public PagedCallSettings.Builder< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - pagedExpandSettings() { - return getStubSettingsBuilder().pagedExpandSettings(); - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings.Builder - pagedExpandLegacySettings() { - return getStubSettingsBuilder().pagedExpandLegacySettings(); - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings.Builder< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return getStubSettingsBuilder().pagedExpandLegacyMappedSettings(); - } - - /** Returns the builder for the settings used for calls to wait. */ - public UnaryCallSettings.Builder waitSettings() { - return getStubSettingsBuilder().waitSettings(); - } - - /** Returns the builder for the settings used for calls to wait. */ - public OperationCallSettings.Builder - waitOperationSettings() { - return getStubSettingsBuilder().waitOperationSettings(); - } - - /** Returns the builder for the settings used for calls to block. */ - public UnaryCallSettings.Builder blockSettings() { - return getStubSettingsBuilder().blockSettings(); - } - - @Override - public EchoSettings build() throws IOException { - return new EchoSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClient.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClient.java deleted file mode 100644 index b50159d6fc..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClient.java +++ /dev/null @@ -1,774 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.IdentityStub; -import com.google.showcase.v1beta1.stub.IdentityStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: A simple identity service. - * - *

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

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

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

To customize credentials: - * - *

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

To customize the endpoint: - * - *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class IdentityClient implements BackgroundResource { - private final IdentitySettings settings; - private final IdentityStub stub; - - /** Constructs an instance of IdentityClient with default settings. */ - public static final IdentityClient create() throws IOException { - return create(IdentitySettings.newBuilder().build()); - } - - /** - * Constructs an instance of IdentityClient, 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 IdentityClient create(IdentitySettings settings) throws IOException { - return new IdentityClient(settings); - } - - /** - * Constructs an instance of IdentityClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(IdentitySettings). - */ - public static final IdentityClient create(IdentityStub stub) { - return new IdentityClient(stub); - } - - /** - * Constructs an instance of IdentityClient, 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 IdentityClient(IdentitySettings settings) throws IOException { - this.settings = settings; - this.stub = ((IdentityStubSettings) settings.getStubSettings()).createStub(); - } - - protected IdentityClient(IdentityStub stub) { - this.settings = null; - this.stub = stub; - } - - public final IdentitySettings getSettings() { - return settings; - } - - public IdentityStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   String displayName = "displayName1714148973";
-   *   String email = "email96619420";
-   *   User response = identityClient.createUser(displayName, email);
-   * }
-   * }
- * - * @param displayName The display_name of the user. - * @param email The email address of the user. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User createUser(String displayName, String email) { - CreateUserRequest request = - CreateUserRequest.newBuilder() - .setUser(User.newBuilder().setDisplayName(displayName).setEmail(email).build()) - .build(); - return createUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   String displayName = "displayName1714148973";
-   *   String email = "email96619420";
-   *   int age = 96511;
-   *   String nickname = "nickname70690926";
-   *   boolean enableNotifications = true;
-   *   double heightFeet = -1032737338;
-   *   User response =
-   *       identityClient.createUser(
-   *           displayName, email, age, nickname, enableNotifications, heightFeet);
-   * }
-   * }
- * - * @param displayName The display_name of the user. - * @param email The email address of the user. - * @param age The age of the user in years. - * @param nickname The nickname of the user. - *

(-- aip.dev/not-precedent: An empty string is a valid nickname. Ordinarily, - * proto3_optional should not be used on a `string` field. --) - * @param enableNotifications Enables the receiving of notifications. The default is true if - * unset. - *

(-- aip.dev/not-precedent: The default for the feature is true. Ordinarily, the default - * for a `bool` field should be false. --) - * @param heightFeet The height of the user in feet. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User createUser( - String displayName, - String email, - int age, - String nickname, - boolean enableNotifications, - double heightFeet) { - CreateUserRequest request = - CreateUserRequest.newBuilder() - .setUser( - User.newBuilder() - .setDisplayName(displayName) - .setEmail(email) - .setAge(age) - .setNickname(nickname) - .setEnableNotifications(enableNotifications) - .setHeightFeet(heightFeet) - .build()) - .build(); - return createUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   CreateUserRequest request =
-   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
-   *   User response = identityClient.createUser(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 User createUser(CreateUserRequest request) { - return createUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   CreateUserRequest request =
-   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
-   *   ApiFuture future = identityClient.createUserCallable().futureCall(request);
-   *   // Do something.
-   *   User response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createUserCallable() { - return stub.createUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   UserName name = UserName.of("[USER]");
-   *   User response = identityClient.getUser(name);
-   * }
-   * }
- * - * @param name The resource name of the requested user. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User getUser(UserName name) { - GetUserRequest request = - GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   String name = UserName.of("[USER]").toString();
-   *   User response = identityClient.getUser(name);
-   * }
-   * }
- * - * @param name The resource name of the requested user. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User getUser(String name) { - GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); - return getUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   GetUserRequest request =
-   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
-   *   User response = identityClient.getUser(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 User getUser(GetUserRequest request) { - return getUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   GetUserRequest request =
-   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
-   *   ApiFuture future = identityClient.getUserCallable().futureCall(request);
-   *   // Do something.
-   *   User response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getUserCallable() { - return stub.getUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a user. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   UpdateUserRequest request =
-   *       UpdateUserRequest.newBuilder()
-   *           .setUser(User.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   User response = identityClient.updateUser(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 User updateUser(UpdateUserRequest request) { - return updateUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a user. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   UpdateUserRequest request =
-   *       UpdateUserRequest.newBuilder()
-   *           .setUser(User.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = identityClient.updateUserCallable().futureCall(request);
-   *   // Do something.
-   *   User response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateUserCallable() { - return stub.updateUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   UserName name = UserName.of("[USER]");
-   *   identityClient.deleteUser(name);
-   * }
-   * }
- * - * @param name The resource name of the user to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUser(UserName name) { - DeleteUserRequest request = - DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   String name = UserName.of("[USER]").toString();
-   *   identityClient.deleteUser(name);
-   * }
-   * }
- * - * @param name The resource name of the user to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUser(String name) { - DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); - deleteUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   DeleteUserRequest request =
-   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
-   *   identityClient.deleteUser(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUser(DeleteUserRequest request) { - deleteUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   DeleteUserRequest request =
-   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
-   *   ApiFuture future = identityClient.deleteUserCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteUserCallable() { - return stub.deleteUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all users. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   ListUsersRequest request =
-   *       ListUsersRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (User element : identityClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) { - return listUsersPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all users. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   ListUsersRequest request =
-   *       ListUsersRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (User element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listUsersPagedCallable() { - return stub.listUsersPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all users. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (IdentityClient identityClient = IdentityClient.create()) {
-   *   ListUsersRequest request =
-   *       ListUsersRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListUsersResponse response = identityClient.listUsersCallable().call(request);
-   *     for (User element : response.getUsersList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listUsersCallable() { - return stub.listUsersCallable(); - } - - @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 ListUsersPagedResponse - extends AbstractPagedListResponse< - ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListUsersPagedResponse(ListUsersPage page) { - super(page, ListUsersFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListUsersPage - extends AbstractPage { - - private ListUsersPage( - PageContext context, - ListUsersResponse response) { - super(context, response); - } - - private static ListUsersPage createEmptyPage() { - return new ListUsersPage(null, null); - } - - @Override - protected ListUsersPage createPage( - PageContext context, - ListUsersResponse response) { - return new ListUsersPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListUsersFixedSizeCollection - extends AbstractFixedSizeCollection< - ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { - - private ListUsersFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListUsersFixedSizeCollection createEmptyCollection() { - return new ListUsersFixedSizeCollection(null, 0); - } - - @Override - protected ListUsersFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListUsersFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java deleted file mode 100644 index 8928792040..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.showcase.v1beta1.stub.HttpJsonIdentityStub; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -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 IdentityClientHttpJsonTest { - private static MockHttpService mockService; - private static IdentityClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonIdentityStub.getMethodDescriptors(), IdentitySettings.getDefaultEndpoint()); - IdentitySettings settings = - IdentitySettings.newHttpJsonBuilder() - .setTransportChannelProvider( - IdentitySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = IdentityClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - - User actualResponse = client.createUser(displayName, email); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - client.createUser(displayName, email); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - - User actualResponse = - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createUserExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - String name = "users/user-6376"; - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getUserExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "users/user-6376"; - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser( - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - User actualResponse = client.updateUser(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser( - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateUser(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - client.deleteUser(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "users/user-6376"; - - client.deleteUser(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteUserExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "users/user-6376"; - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listUsersTest() throws Exception { - User responsesElement = User.newBuilder().build(); - ListUsersResponse expectedResponse = - ListUsersResponse.newBuilder() - .setNextPageToken("") - .addAllUsers(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListUsersPagedResponse pagedListResponse = client.listUsers(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listUsersExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listUsers(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientTest.java deleted file mode 100644 index acbfbedb75..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentityClientTest.java +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -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.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -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.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class IdentityClientTest { - private static MockIdentity mockIdentity; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private IdentityClient client; - - @BeforeClass - public static void startStaticServer() { - mockIdentity = new MockIdentity(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockIdentity)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - IdentitySettings settings = - IdentitySettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = IdentityClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - - User actualResponse = client.createUser(displayName, email); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); - - Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); - Assert.assertEquals(email, actualRequest.getUser().getEmail()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - client.createUser(displayName, email); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - - User actualResponse = - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); - - Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); - Assert.assertEquals(email, actualRequest.getUser().getEmail()); - Assert.assertEquals(age, actualRequest.getUser().getAge()); - Assert.assertEquals(nickname, actualRequest.getUser().getNickname()); - Assert.assertEquals(enableNotifications, actualRequest.getUser().getEnableNotifications()); - Assert.assertEquals(heightFeet, actualRequest.getUser().getHeightFeet(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createUserExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - String name = "name3373707"; - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getUserExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String name = "name3373707"; - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser(User.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - User actualResponse = client.updateUser(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getUser(), actualRequest.getUser()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser(User.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateUser(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockIdentity.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - client.deleteUser(name); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockIdentity.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteUser(name); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteUserExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String name = "name3373707"; - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listUsersTest() throws Exception { - User responsesElement = User.newBuilder().build(); - ListUsersResponse expectedResponse = - ListUsersResponse.newBuilder() - .setNextPageToken("") - .addAllUsers(Arrays.asList(responsesElement)) - .build(); - mockIdentity.addResponse(expectedResponse); - - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListUsersPagedResponse pagedListResponse = client.listUsers(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listUsersExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listUsers(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentitySettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentitySettings.java deleted file mode 100644 index f4db5be8a8..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/IdentitySettings.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.IdentityStubSettings; -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 IdentityClient}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createUser to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder();
- * identitySettingsBuilder
- *     .createUserSettings()
- *     .setRetrySettings(
- *         identitySettingsBuilder
- *             .createUserSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * IdentitySettings identitySettings = identitySettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class IdentitySettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createUser. */ - public UnaryCallSettings createUserSettings() { - return ((IdentityStubSettings) getStubSettings()).createUserSettings(); - } - - /** Returns the object with the settings used for calls to getUser. */ - public UnaryCallSettings getUserSettings() { - return ((IdentityStubSettings) getStubSettings()).getUserSettings(); - } - - /** Returns the object with the settings used for calls to updateUser. */ - public UnaryCallSettings updateUserSettings() { - return ((IdentityStubSettings) getStubSettings()).updateUserSettings(); - } - - /** Returns the object with the settings used for calls to deleteUser. */ - public UnaryCallSettings deleteUserSettings() { - return ((IdentityStubSettings) getStubSettings()).deleteUserSettings(); - } - - /** Returns the object with the settings used for calls to listUsers. */ - public PagedCallSettings - listUsersSettings() { - return ((IdentityStubSettings) getStubSettings()).listUsersSettings(); - } - - public static final IdentitySettings create(IdentityStubSettings stub) throws IOException { - return new IdentitySettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return IdentityStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return IdentityStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return IdentityStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return IdentityStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return IdentityStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return IdentityStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return IdentityStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return IdentityStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected IdentitySettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for IdentitySettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(IdentityStubSettings.newBuilder(clientContext)); - } - - protected Builder(IdentitySettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(IdentityStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(IdentityStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(IdentityStubSettings.newHttpJsonBuilder()); - } - - public IdentityStubSettings.Builder getStubSettingsBuilder() { - return ((IdentityStubSettings.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 createUser. */ - public UnaryCallSettings.Builder createUserSettings() { - return getStubSettingsBuilder().createUserSettings(); - } - - /** Returns the builder for the settings used for calls to getUser. */ - public UnaryCallSettings.Builder getUserSettings() { - return getStubSettingsBuilder().getUserSettings(); - } - - /** Returns the builder for the settings used for calls to updateUser. */ - public UnaryCallSettings.Builder updateUserSettings() { - return getStubSettingsBuilder().updateUserSettings(); - } - - /** Returns the builder for the settings used for calls to deleteUser. */ - public UnaryCallSettings.Builder deleteUserSettings() { - return getStubSettingsBuilder().deleteUserSettings(); - } - - /** Returns the builder for the settings used for calls to listUsers. */ - public PagedCallSettings.Builder - listUsersSettings() { - return getStubSettingsBuilder().listUsersSettings(); - } - - @Override - public IdentitySettings build() throws IOException { - return new IdentitySettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClient.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClient.java deleted file mode 100644 index e19a62a25b..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClient.java +++ /dev/null @@ -1,2117 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.httpjson.longrunning.OperationsClient; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.longrunning.Operation; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.MessagingStub; -import com.google.showcase.v1beta1.stub.MessagingStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: A simple messaging service that implements chat rooms and profile posts. - * - *

This messaging service showcases the features that API clients generated by gapic-generators - * implement. - * - *

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

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

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

To customize credentials: - * - *

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

To customize the endpoint: - * - *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class MessagingClient implements BackgroundResource { - private final MessagingSettings settings; - private final MessagingStub stub; - private final OperationsClient httpJsonOperationsClient; - private final com.google.longrunning.OperationsClient operationsClient; - - /** Constructs an instance of MessagingClient with default settings. */ - public static final MessagingClient create() throws IOException { - return create(MessagingSettings.newBuilder().build()); - } - - /** - * Constructs an instance of MessagingClient, 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 MessagingClient create(MessagingSettings settings) throws IOException { - return new MessagingClient(settings); - } - - /** - * Constructs an instance of MessagingClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(MessagingSettings). - */ - public static final MessagingClient create(MessagingStub stub) { - return new MessagingClient(stub); - } - - /** - * Constructs an instance of MessagingClient, 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 MessagingClient(MessagingSettings settings) throws IOException { - this.settings = settings; - this.stub = ((MessagingStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - protected MessagingClient(MessagingStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - public final MessagingSettings getSettings() { - return settings; - } - - public MessagingStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - public final com.google.longrunning.OperationsClient getOperationsClient() { - return operationsClient; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi - public final OperationsClient getHttpJsonOperationsClient() { - return httpJsonOperationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a room. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String displayName = "displayName1714148973";
-   *   String description = "description-1724546052";
-   *   Room response = messagingClient.createRoom(displayName, description);
-   * }
-   * }
- * - * @param displayName The human readable name of the chat room. - * @param description The description of the chat room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Room createRoom(String displayName, String description) { - CreateRoomRequest request = - CreateRoomRequest.newBuilder() - .setRoom( - Room.newBuilder().setDisplayName(displayName).setDescription(description).build()) - .build(); - return createRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a room. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   CreateRoomRequest request =
-   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
-   *   Room response = messagingClient.createRoom(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 Room createRoom(CreateRoomRequest request) { - return createRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a room. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   CreateRoomRequest request =
-   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
-   *   ApiFuture future = messagingClient.createRoomCallable().futureCall(request);
-   *   // Do something.
-   *   Room response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createRoomCallable() { - return stub.createRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName name = RoomName.of("[ROOM]");
-   *   Room response = messagingClient.getRoom(name);
-   * }
-   * }
- * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Room getRoom(RoomName name) { - GetRoomRequest request = - GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String name = RoomName.of("[ROOM]").toString();
-   *   Room response = messagingClient.getRoom(name);
-   * }
-   * }
- * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Room getRoom(String name) { - GetRoomRequest request = GetRoomRequest.newBuilder().setName(name).build(); - return getRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   GetRoomRequest request =
-   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
-   *   Room response = messagingClient.getRoom(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 Room getRoom(GetRoomRequest request) { - return getRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   GetRoomRequest request =
-   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
-   *   ApiFuture future = messagingClient.getRoomCallable().futureCall(request);
-   *   // Do something.
-   *   Room response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getRoomCallable() { - return stub.getRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a room. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   UpdateRoomRequest request =
-   *       UpdateRoomRequest.newBuilder()
-   *           .setRoom(Room.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Room response = messagingClient.updateRoom(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 Room updateRoom(UpdateRoomRequest request) { - return updateRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a room. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   UpdateRoomRequest request =
-   *       UpdateRoomRequest.newBuilder()
-   *           .setRoom(Room.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = messagingClient.updateRoomCallable().futureCall(request);
-   *   // Do something.
-   *   Room response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateRoomCallable() { - return stub.updateRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName name = RoomName.of("[ROOM]");
-   *   messagingClient.deleteRoom(name);
-   * }
-   * }
- * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteRoom(RoomName name) { - DeleteRoomRequest request = - DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String name = RoomName.of("[ROOM]").toString();
-   *   messagingClient.deleteRoom(name);
-   * }
-   * }
- * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteRoom(String name) { - DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name).build(); - deleteRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   DeleteRoomRequest request =
-   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
-   *   messagingClient.deleteRoom(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteRoom(DeleteRoomRequest request) { - deleteRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   DeleteRoomRequest request =
-   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
-   *   ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteRoomCallable() { - return stub.deleteRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all chat rooms. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ListRoomsRequest request =
-   *       ListRoomsRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Room element : messagingClient.listRooms(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 ListRoomsPagedResponse listRooms(ListRoomsRequest request) { - return listRoomsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all chat rooms. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ListRoomsRequest request =
-   *       ListRoomsRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Room element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listRoomsPagedCallable() { - return stub.listRoomsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all chat rooms. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ListRoomsRequest request =
-   *       ListRoomsRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
-   *     for (Room element : response.getRoomsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listRoomsCallable() { - return stub.listRoomsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ProfileName parent = ProfileName.of("[USER]");
-   *   UserName user = UserName.of("[USER]");
-   *   ByteString image = ByteString.EMPTY;
-   *   Blurb response = messagingClient.createBlurb(parent, user, image);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ProfileName parent = ProfileName.of("[USER]");
-   *   UserName user = UserName.of("[USER]");
-   *   String text = "text3556653";
-   *   Blurb response = messagingClient.createBlurb(parent, user, text);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, UserName user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ProfileName parent = ProfileName.of("[USER]");
-   *   String user = UserName.of("[USER]").toString();
-   *   ByteString image = ByteString.EMPTY;
-   *   Blurb response = messagingClient.createBlurb(parent, user, image);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ProfileName parent = ProfileName.of("[USER]");
-   *   String user = UserName.of("[USER]").toString();
-   *   String text = "text3556653";
-   *   Blurb response = messagingClient.createBlurb(parent, user, text);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, String user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName parent = RoomName.of("[ROOM]");
-   *   UserName user = UserName.of("[USER]");
-   *   ByteString image = ByteString.EMPTY;
-   *   Blurb response = messagingClient.createBlurb(parent, user, image);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName parent = RoomName.of("[ROOM]");
-   *   UserName user = UserName.of("[USER]");
-   *   String text = "text3556653";
-   *   Blurb response = messagingClient.createBlurb(parent, user, text);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, UserName user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName parent = RoomName.of("[ROOM]");
-   *   String user = UserName.of("[USER]").toString();
-   *   ByteString image = ByteString.EMPTY;
-   *   Blurb response = messagingClient.createBlurb(parent, user, image);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, String user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName parent = RoomName.of("[ROOM]");
-   *   String user = UserName.of("[USER]").toString();
-   *   String text = "text3556653";
-   *   Blurb response = messagingClient.createBlurb(parent, user, text);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, String user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String parent = ProfileName.of("[USER]").toString();
-   *   UserName user = UserName.of("[USER]");
-   *   ByteString image = ByteString.EMPTY;
-   *   Blurb response = messagingClient.createBlurb(parent, user, image);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, UserName user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String parent = ProfileName.of("[USER]").toString();
-   *   UserName user = UserName.of("[USER]");
-   *   String text = "text3556653";
-   *   Blurb response = messagingClient.createBlurb(parent, user, text);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, UserName user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String parent = ProfileName.of("[USER]").toString();
-   *   String user = UserName.of("[USER]").toString();
-   *   ByteString image = ByteString.EMPTY;
-   *   Blurb response = messagingClient.createBlurb(parent, user, image);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, String user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String parent = ProfileName.of("[USER]").toString();
-   *   String user = UserName.of("[USER]").toString();
-   *   String text = "text3556653";
-   *   Blurb response = messagingClient.createBlurb(parent, user, text);
-   * }
-   * }
- * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, String user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   CreateBlurbRequest request =
-   *       CreateBlurbRequest.newBuilder()
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setBlurb(Blurb.newBuilder().build())
-   *           .build();
-   *   Blurb response = messagingClient.createBlurb(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 Blurb createBlurb(CreateBlurbRequest request) { - return createBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   CreateBlurbRequest request =
-   *       CreateBlurbRequest.newBuilder()
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setBlurb(Blurb.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = messagingClient.createBlurbCallable().futureCall(request);
-   *   // Do something.
-   *   Blurb response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createBlurbCallable() { - return stub.createBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
-   *   Blurb response = messagingClient.getBlurb(name);
-   * }
-   * }
- * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb getBlurb(BlurbName name) { - GetBlurbRequest request = - GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String name =
-   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
-   *   Blurb response = messagingClient.getBlurb(name);
-   * }
-   * }
- * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb getBlurb(String name) { - GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name).build(); - return getBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   GetBlurbRequest request =
-   *       GetBlurbRequest.newBuilder()
-   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
-   *           .build();
-   *   Blurb response = messagingClient.getBlurb(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 Blurb getBlurb(GetBlurbRequest request) { - return getBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   GetBlurbRequest request =
-   *       GetBlurbRequest.newBuilder()
-   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
-   *           .build();
-   *   ApiFuture future = messagingClient.getBlurbCallable().futureCall(request);
-   *   // Do something.
-   *   Blurb response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getBlurbCallable() { - return stub.getBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a blurb. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   UpdateBlurbRequest request =
-   *       UpdateBlurbRequest.newBuilder()
-   *           .setBlurb(Blurb.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Blurb response = messagingClient.updateBlurb(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 Blurb updateBlurb(UpdateBlurbRequest request) { - return updateBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a blurb. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   UpdateBlurbRequest request =
-   *       UpdateBlurbRequest.newBuilder()
-   *           .setBlurb(Blurb.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request);
-   *   // Do something.
-   *   Blurb response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateBlurbCallable() { - return stub.updateBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
-   *   messagingClient.deleteBlurb(name);
-   * }
-   * }
- * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBlurb(BlurbName name) { - DeleteBlurbRequest request = - DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String name =
-   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
-   *   messagingClient.deleteBlurb(name);
-   * }
-   * }
- * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBlurb(String name) { - DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name).build(); - deleteBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   DeleteBlurbRequest request =
-   *       DeleteBlurbRequest.newBuilder()
-   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
-   *           .build();
-   *   messagingClient.deleteBlurb(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBlurb(DeleteBlurbRequest request) { - deleteBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   DeleteBlurbRequest request =
-   *       DeleteBlurbRequest.newBuilder()
-   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
-   *           .build();
-   *   ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteBlurbCallable() { - return stub.deleteBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ProfileName parent = ProfileName.of("[USER]");
-   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent The resource name of the requested room or profile whos blurbs to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); - return listBlurbs(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName parent = RoomName.of("[ROOM]");
-   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent The resource name of the requested room or profile whos blurbs to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); - return listBlurbs(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String parent = ProfileName.of("[USER]").toString();
-   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent The resource name of the requested room or profile whos blurbs to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBlurbsPagedResponse listBlurbs(String parent) { - ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent).build(); - return listBlurbs(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ListBlurbsRequest request =
-   *       ListBlurbsRequest.newBuilder()
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Blurb element : messagingClient.listBlurbs(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 ListBlurbsPagedResponse listBlurbs(ListBlurbsRequest request) { - return listBlurbsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ListBlurbsRequest request =
-   *       ListBlurbsRequest.newBuilder()
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Blurb element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listBlurbsPagedCallable() { - return stub.listBlurbsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ListBlurbsRequest request =
-   *       ListBlurbsRequest.newBuilder()
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
-   *     for (Blurb element : response.getBlurbsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listBlurbsCallable() { - return stub.listBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ProfileName parent = ProfileName.of("[USER]");
-   *   String query = "query107944136";
-   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
-   * }
-   * }
- * - * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms - * and all profiles. - * @param query The query used to search for blurbs containing to words of this string. Only posts - * that contain an exact match of a queried word will be returned. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture searchBlurbsAsync( - ProfileName parent, String query) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setQuery(query) - .build(); - return searchBlurbsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   RoomName parent = RoomName.of("[ROOM]");
-   *   String query = "query107944136";
-   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
-   * }
-   * }
- * - * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms - * and all profiles. - * @param query The query used to search for blurbs containing to words of this string. Only posts - * that contain an exact match of a queried word will be returned. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture searchBlurbsAsync( - RoomName parent, String query) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setQuery(query) - .build(); - return searchBlurbsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   String parent = ProfileName.of("[USER]").toString();
-   *   String query = "query107944136";
-   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
-   * }
-   * }
- * - * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms - * and all profiles. - * @param query The query used to search for blurbs containing to words of this string. Only posts - * that contain an exact match of a queried word will be returned. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture searchBlurbsAsync( - String parent, String query) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder().setParent(parent).setQuery(query).build(); - return searchBlurbsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   SearchBlurbsRequest request =
-   *       SearchBlurbsRequest.newBuilder()
-   *           .setQuery("query107944136")
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(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 searchBlurbsAsync( - SearchBlurbsRequest request) { - return searchBlurbsOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   SearchBlurbsRequest request =
-   *       SearchBlurbsRequest.newBuilder()
-   *           .setQuery("query107944136")
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   OperationFuture future =
-   *       messagingClient.searchBlurbsOperationCallable().futureCall(request);
-   *   // Do something.
-   *   SearchBlurbsResponse response = future.get();
-   * }
-   * }
- */ - public final OperationCallable - searchBlurbsOperationCallable() { - return stub.searchBlurbsOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   SearchBlurbsRequest request =
-   *       SearchBlurbsRequest.newBuilder()
-   *           .setQuery("query107944136")
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request);
-   *   // Do something.
-   *   Operation response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable searchBlurbsCallable() { - return stub.searchBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This returns a stream that emits the blurbs that are created for a particular chat room or user - * profile. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   StreamBlurbsRequest request =
-   *       StreamBlurbsRequest.newBuilder()
-   *           .setName(ProfileName.of("[USER]").toString())
-   *           .setExpireTime(Timestamp.newBuilder().build())
-   *           .build();
-   *   ServerStream stream =
-   *       messagingClient.streamBlurbsCallable().call(request);
-   *   for (StreamBlurbsResponse response : stream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final ServerStreamingCallable - streamBlurbsCallable() { - return stub.streamBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the - * stream will close with an error. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   ApiStreamObserver responseObserver =
-   *       new ApiStreamObserver() {
-   *         {@literal @}Override
-   *         public void onNext(SendBlurbsResponse response) {
-   *           // Do something when a response is received.
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver requestObserver =
-   *       messagingClient.sendBlurbs().clientStreamingCall(responseObserver);
-   *   CreateBlurbRequest request =
-   *       CreateBlurbRequest.newBuilder()
-   *           .setParent(ProfileName.of("[USER]").toString())
-   *           .setBlurb(Blurb.newBuilder().build())
-   *           .build();
-   *   requestObserver.onNext(request);
-   * }
-   * }
- */ - public final ClientStreamingCallable - sendBlurbsCallable() { - return stub.sendBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method starts a bidirectional stream that receives all blurbs that are being created after - * the stream has started and sends requests to create blurbs. If an invalid blurb is requested to - * be created, the stream will close with an error. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (MessagingClient messagingClient = MessagingClient.create()) {
-   *   BidiStream bidiStream =
-   *       messagingClient.connectCallable().call();
-   *   ConnectRequest request = ConnectRequest.newBuilder().build();
-   *   bidiStream.send(request);
-   *   for (StreamBlurbsResponse response : bidiStream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final BidiStreamingCallable connectCallable() { - return stub.connectCallable(); - } - - @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 ListRoomsPagedResponse - extends AbstractPagedListResponse< - ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListRoomsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListRoomsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListRoomsPagedResponse(ListRoomsPage page) { - super(page, ListRoomsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListRoomsPage - extends AbstractPage { - - private ListRoomsPage( - PageContext context, - ListRoomsResponse response) { - super(context, response); - } - - private static ListRoomsPage createEmptyPage() { - return new ListRoomsPage(null, null); - } - - @Override - protected ListRoomsPage createPage( - PageContext context, - ListRoomsResponse response) { - return new ListRoomsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListRoomsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { - - private ListRoomsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListRoomsFixedSizeCollection createEmptyCollection() { - return new ListRoomsFixedSizeCollection(null, 0); - } - - @Override - protected ListRoomsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListRoomsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListBlurbsPagedResponse - extends AbstractPagedListResponse< - ListBlurbsRequest, - ListBlurbsResponse, - Blurb, - ListBlurbsPage, - ListBlurbsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListBlurbsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListBlurbsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListBlurbsPagedResponse(ListBlurbsPage page) { - super(page, ListBlurbsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListBlurbsPage - extends AbstractPage { - - private ListBlurbsPage( - PageContext context, - ListBlurbsResponse response) { - super(context, response); - } - - private static ListBlurbsPage createEmptyPage() { - return new ListBlurbsPage(null, null); - } - - @Override - protected ListBlurbsPage createPage( - PageContext context, - ListBlurbsResponse response) { - return new ListBlurbsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListBlurbsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListBlurbsRequest, - ListBlurbsResponse, - Blurb, - ListBlurbsPage, - ListBlurbsFixedSizeCollection> { - - private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListBlurbsFixedSizeCollection createEmptyCollection() { - return new ListBlurbsFixedSizeCollection(null, 0); - } - - @Override - protected ListBlurbsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListBlurbsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java deleted file mode 100644 index de062e07f3..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java +++ /dev/null @@ -1,1649 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.showcase.v1beta1.stub.HttpJsonMessagingStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class MessagingClientHttpJsonTest { - private static MockHttpService mockService; - private static MessagingClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonMessagingStub.getMethodDescriptors(), MessagingSettings.getDefaultEndpoint()); - MessagingSettings settings = - MessagingSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - MessagingSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = MessagingClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - - Room actualResponse = client.createRoom(displayName, description); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - client.createRoom(displayName, description); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest2() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-472"; - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getRoomExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-472"; - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom( - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Room actualResponse = client.updateRoom(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom( - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateRoom(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - client.deleteRoom(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-472"; - - client.deleteRoom(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteRoomExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-472"; - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listRoomsTest() throws Exception { - Room responsesElement = Room.newBuilder().build(); - ListRoomsResponse expectedResponse = - ListRoomsResponse.newBuilder() - .setNextPageToken("") - .addAllRooms(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListRoomsPagedResponse pagedListResponse = client.listRooms(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listRoomsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listRooms(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest3() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest4() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest4() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest5() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest5() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest6() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest6() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest7() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest7() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest8() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest8() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest9() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest9() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest10() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest10() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest11() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest11() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest12() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest12() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-9094/blurbs/blurb-9094"; - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getBlurbExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-9094/blurbs/blurb-9094"; - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb( - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Blurb actualResponse = client.updateBlurb(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb( - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateBlurb(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - client.deleteBlurb(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-9094/blurbs/blurb-9094"; - - client.deleteBlurb(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteBlurbExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-9094/blurbs/blurb-9094"; - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listBlurbsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest2() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listBlurbsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest3() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listBlurbsExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void searchBlurbsTest() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void searchBlurbsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void searchBlurbsTest2() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void searchBlurbsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void searchBlurbsTest3() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - String parent = "rooms/room-4889"; - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void searchBlurbsExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void streamBlurbsTest() throws Exception {} - - @Test - public void streamBlurbsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - } - - @Test - public void sendBlurbsUnsupportedMethodTest() throws Exception { - // The sendBlurbs() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void connectUnsupportedMethodTest() throws Exception { - // The connect() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientTest.java deleted file mode 100644 index 0f4e531141..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingClientTest.java +++ /dev/null @@ -1,1614 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -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.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.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.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 MessagingClientTest { - private static MockMessaging mockMessaging; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private MessagingClient client; - - @BeforeClass - public static void startStaticServer() { - mockMessaging = new MockMessaging(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockMessaging)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - MessagingSettings settings = - MessagingSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = MessagingClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - - Room actualResponse = client.createRoom(displayName, description); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateRoomRequest actualRequest = ((CreateRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(displayName, actualRequest.getRoom().getDisplayName()); - Assert.assertEquals(description, actualRequest.getRoom().getDescription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - client.createRoom(displayName, description); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest2() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getRoomExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom(Room.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Room actualResponse = client.updateRoom(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateRoomRequest actualRequest = ((UpdateRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getRoom(), actualRequest.getRoom()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom(Room.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateRoom(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - client.deleteRoom(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteRoom(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteRoomExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listRoomsTest() throws Exception { - Room responsesElement = Room.newBuilder().build(); - ListRoomsResponse expectedResponse = - ListRoomsResponse.newBuilder() - .setNextPageToken("") - .addAllRooms(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListRoomsPagedResponse pagedListResponse = client.listRooms(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListRoomsRequest actualRequest = ((ListRoomsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listRoomsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listRooms(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest3() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest4() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest5() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest6() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest6() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest7() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest7() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest8() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest8() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest9() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest9() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest10() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest10() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest11() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest11() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest12() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest12() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getBlurbExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb(Blurb.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Blurb actualResponse = client.updateBlurb(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBlurbRequest actualRequest = ((UpdateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getBlurb(), actualRequest.getBlurb()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb(Blurb.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateBlurb(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - client.deleteBlurb(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteBlurb(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteBlurbExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest2() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBlurbsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest3() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBlurbsExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void searchBlurbsTest() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockMessaging.addResponse(resultOperation); - - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(query, actualRequest.getQuery()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void searchBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).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 searchBlurbsTest2() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockMessaging.addResponse(resultOperation); - - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(query, actualRequest.getQuery()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void searchBlurbsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).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 searchBlurbsTest3() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockMessaging.addResponse(resultOperation); - - String parent = "parent-995424086"; - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(query, actualRequest.getQuery()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void searchBlurbsExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).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 streamBlurbsTest() throws Exception { - StreamBlurbsResponse expectedResponse = - StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); - mockMessaging.addResponse(expectedResponse); - StreamBlurbsRequest request = - StreamBlurbsRequest.newBuilder() - .setName(ProfileName.of("[USER]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBlurbsCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void streamBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - StreamBlurbsRequest request = - StreamBlurbsRequest.newBuilder() - .setName(ProfileName.of("[USER]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBlurbsCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void sendBlurbsTest() throws Exception { - SendBlurbsResponse expectedResponse = - SendBlurbsResponse.newBuilder().addAllNames(new ArrayList()).build(); - mockMessaging.addResponse(expectedResponse); - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = - client.sendBlurbsCallable(); - ApiStreamObserver requestObserver = - callable.clientStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void sendBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = - client.sendBlurbsCallable(); - ApiStreamObserver requestObserver = - callable.clientStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void connectTest() throws Exception { - StreamBlurbsResponse expectedResponse = - StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); - mockMessaging.addResponse(expectedResponse); - ConnectRequest request = ConnectRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.connectCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void connectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - ConnectRequest request = ConnectRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.connectCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingSettings.java deleted file mode 100644 index 2196181ea3..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MessagingSettings.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.MessagingStubSettings; -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 MessagingClient}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createRoom to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
- * messagingSettingsBuilder
- *     .createRoomSettings()
- *     .setRetrySettings(
- *         messagingSettingsBuilder
- *             .createRoomSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * MessagingSettings messagingSettings = messagingSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class MessagingSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createRoom. */ - public UnaryCallSettings createRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).createRoomSettings(); - } - - /** Returns the object with the settings used for calls to getRoom. */ - public UnaryCallSettings getRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).getRoomSettings(); - } - - /** Returns the object with the settings used for calls to updateRoom. */ - public UnaryCallSettings updateRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).updateRoomSettings(); - } - - /** Returns the object with the settings used for calls to deleteRoom. */ - public UnaryCallSettings deleteRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).deleteRoomSettings(); - } - - /** Returns the object with the settings used for calls to listRooms. */ - public PagedCallSettings - listRoomsSettings() { - return ((MessagingStubSettings) getStubSettings()).listRoomsSettings(); - } - - /** Returns the object with the settings used for calls to createBlurb. */ - public UnaryCallSettings createBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).createBlurbSettings(); - } - - /** Returns the object with the settings used for calls to getBlurb. */ - public UnaryCallSettings getBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).getBlurbSettings(); - } - - /** Returns the object with the settings used for calls to updateBlurb. */ - public UnaryCallSettings updateBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).updateBlurbSettings(); - } - - /** Returns the object with the settings used for calls to deleteBlurb. */ - public UnaryCallSettings deleteBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).deleteBlurbSettings(); - } - - /** Returns the object with the settings used for calls to listBlurbs. */ - public PagedCallSettings - listBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).listBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public UnaryCallSettings searchBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).searchBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public OperationCallSettings - searchBlurbsOperationSettings() { - return ((MessagingStubSettings) getStubSettings()).searchBlurbsOperationSettings(); - } - - /** Returns the object with the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings - streamBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).streamBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to sendBlurbs. */ - public StreamingCallSettings sendBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).sendBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to connect. */ - public StreamingCallSettings connectSettings() { - return ((MessagingStubSettings) getStubSettings()).connectSettings(); - } - - public static final MessagingSettings create(MessagingStubSettings stub) throws IOException { - return new MessagingSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return MessagingStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return MessagingStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return MessagingStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return MessagingStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return MessagingStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return MessagingStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return MessagingStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return MessagingStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected MessagingSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for MessagingSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(MessagingStubSettings.newBuilder(clientContext)); - } - - protected Builder(MessagingSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(MessagingStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(MessagingStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(MessagingStubSettings.newHttpJsonBuilder()); - } - - public MessagingStubSettings.Builder getStubSettingsBuilder() { - return ((MessagingStubSettings.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 createRoom. */ - public UnaryCallSettings.Builder createRoomSettings() { - return getStubSettingsBuilder().createRoomSettings(); - } - - /** Returns the builder for the settings used for calls to getRoom. */ - public UnaryCallSettings.Builder getRoomSettings() { - return getStubSettingsBuilder().getRoomSettings(); - } - - /** Returns the builder for the settings used for calls to updateRoom. */ - public UnaryCallSettings.Builder updateRoomSettings() { - return getStubSettingsBuilder().updateRoomSettings(); - } - - /** Returns the builder for the settings used for calls to deleteRoom. */ - public UnaryCallSettings.Builder deleteRoomSettings() { - return getStubSettingsBuilder().deleteRoomSettings(); - } - - /** Returns the builder for the settings used for calls to listRooms. */ - public PagedCallSettings.Builder - listRoomsSettings() { - return getStubSettingsBuilder().listRoomsSettings(); - } - - /** Returns the builder for the settings used for calls to createBlurb. */ - public UnaryCallSettings.Builder createBlurbSettings() { - return getStubSettingsBuilder().createBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to getBlurb. */ - public UnaryCallSettings.Builder getBlurbSettings() { - return getStubSettingsBuilder().getBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to updateBlurb. */ - public UnaryCallSettings.Builder updateBlurbSettings() { - return getStubSettingsBuilder().updateBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to deleteBlurb. */ - public UnaryCallSettings.Builder deleteBlurbSettings() { - return getStubSettingsBuilder().deleteBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to listBlurbs. */ - public PagedCallSettings.Builder - listBlurbsSettings() { - return getStubSettingsBuilder().listBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - public UnaryCallSettings.Builder searchBlurbsSettings() { - return getStubSettingsBuilder().searchBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - public OperationCallSettings.Builder< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings() { - return getStubSettingsBuilder().searchBlurbsOperationSettings(); - } - - /** Returns the builder for the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings.Builder - streamBlurbsSettings() { - return getStubSettingsBuilder().streamBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to sendBlurbs. */ - public StreamingCallSettings.Builder - sendBlurbsSettings() { - return getStubSettingsBuilder().sendBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to connect. */ - public StreamingCallSettings.Builder connectSettings() { - return getStubSettingsBuilder().connectSettings(); - } - - @Override - public MessagingSettings build() throws IOException { - return new MessagingSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockCompliance.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockCompliance.java deleted file mode 100644 index 5c86c23a02..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockCompliance.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockCompliance implements MockGrpcService { - private final MockComplianceImpl serviceImpl; - - public MockCompliance() { - serviceImpl = new MockComplianceImpl(); - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockComplianceImpl.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockComplianceImpl.java deleted file mode 100644 index 5d27cb09c2..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockComplianceImpl.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.showcase.v1beta1.ComplianceGrpc.ComplianceImplBase; -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 MockComplianceImpl extends ComplianceImplBase { - private List requests; - private Queue responses; - - public MockComplianceImpl() { - 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 repeatDataBody( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBody, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataBodyInfo( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyInfo, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataQuery( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataQuery, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataSimplePath( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataSimplePath, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataPathResource( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataPathTrailingResource( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathTrailingResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataBodyPut( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPut, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataBodyPatch( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPatch, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getEnum(EnumRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EnumResponse) { - requests.add(request); - responseObserver.onNext(((EnumResponse) 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 GetEnum, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EnumResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void verifyEnum(EnumResponse request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EnumResponse) { - requests.add(request); - responseObserver.onNext(((EnumResponse) 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 VerifyEnum, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EnumResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEcho.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEcho.java deleted file mode 100644 index 713524d540..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEcho.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockEcho implements MockGrpcService { - private final MockEchoImpl serviceImpl; - - public MockEcho() { - serviceImpl = new MockEchoImpl(); - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEchoImpl.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEchoImpl.java deleted file mode 100644 index ebb4bab00d..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockEchoImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.showcase.v1beta1.EchoGrpc.EchoImplBase; -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 MockEchoImpl extends EchoImplBase { - private List requests; - private Queue responses; - - public MockEchoImpl() { - 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 echo(EchoRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EchoResponse) { - requests.add(request); - responseObserver.onNext(((EchoResponse) 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 Echo, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void expand(ExpandRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EchoResponse) { - requests.add(request); - responseObserver.onNext(((EchoResponse) 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 Expand, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver collect(final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(EchoRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof EchoResponse) { - responseObserver.onNext(((EchoResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Collect, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public StreamObserver chat(final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(EchoRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof EchoResponse) { - responseObserver.onNext(((EchoResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Chat, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public void pagedExpand( - PagedExpandRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PagedExpandResponse) { - requests.add(request); - responseObserver.onNext(((PagedExpandResponse) 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 PagedExpand, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PagedExpandResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void pagedExpandLegacy( - PagedExpandLegacyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PagedExpandResponse) { - requests.add(request); - responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PagedExpandResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void pagedExpandLegacyMapped( - PagedExpandRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PagedExpandLegacyMappedResponse) { - requests.add(request); - responseObserver.onNext(((PagedExpandLegacyMappedResponse) 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 PagedExpandLegacyMapped, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PagedExpandLegacyMappedResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void wait(WaitRequest 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 Wait, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void block(BlockRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof BlockResponse) { - requests.add(request); - responseObserver.onNext(((BlockResponse) 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 Block, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - BlockResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentity.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentity.java deleted file mode 100644 index c1fa686113..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentity.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIdentity implements MockGrpcService { - private final MockIdentityImpl serviceImpl; - - public MockIdentity() { - serviceImpl = new MockIdentityImpl(); - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentityImpl.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentityImpl.java deleted file mode 100644 index 508e333af6..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockIdentityImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.IdentityGrpc.IdentityImplBase; -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 MockIdentityImpl extends IdentityImplBase { - private List requests; - private Queue responses; - - public MockIdentityImpl() { - 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 createUser(CreateUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof User) { - requests.add(request); - responseObserver.onNext(((User) 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 CreateUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - User.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getUser(GetUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof User) { - requests.add(request); - responseObserver.onNext(((User) 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 GetUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - User.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof User) { - requests.add(request); - responseObserver.onNext(((User) 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 UpdateUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - User.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteUser(DeleteUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) 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 DeleteUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listUsers( - ListUsersRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListUsersResponse) { - requests.add(request); - responseObserver.onNext(((ListUsersResponse) 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 ListUsers, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListUsersResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessaging.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessaging.java deleted file mode 100644 index 213a8982b8..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessaging.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockMessaging implements MockGrpcService { - private final MockMessagingImpl serviceImpl; - - public MockMessaging() { - serviceImpl = new MockMessagingImpl(); - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessagingImpl.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessagingImpl.java deleted file mode 100644 index f14386051c..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockMessagingImpl.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.MessagingGrpc.MessagingImplBase; -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 MockMessagingImpl extends MessagingImplBase { - private List requests; - private Queue responses; - - public MockMessagingImpl() { - 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 createRoom(CreateRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Room) { - requests.add(request); - responseObserver.onNext(((Room) 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 CreateRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Room.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getRoom(GetRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Room) { - requests.add(request); - responseObserver.onNext(((Room) 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 GetRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Room.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateRoom(UpdateRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Room) { - requests.add(request); - responseObserver.onNext(((Room) 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 UpdateRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Room.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteRoom(DeleteRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) 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 DeleteRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listRooms( - ListRoomsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListRoomsResponse) { - requests.add(request); - responseObserver.onNext(((ListRoomsResponse) 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 ListRooms, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListRoomsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createBlurb(CreateBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Blurb) { - requests.add(request); - responseObserver.onNext(((Blurb) 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 CreateBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Blurb.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getBlurb(GetBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Blurb) { - requests.add(request); - responseObserver.onNext(((Blurb) 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 GetBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Blurb.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateBlurb(UpdateBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Blurb) { - requests.add(request); - responseObserver.onNext(((Blurb) 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 UpdateBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Blurb.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteBlurb(DeleteBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) 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 DeleteBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listBlurbs( - ListBlurbsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListBlurbsResponse) { - requests.add(request); - responseObserver.onNext(((ListBlurbsResponse) 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 ListBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void searchBlurbs( - SearchBlurbsRequest 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 SearchBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void streamBlurbs( - StreamBlurbsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof StreamBlurbsResponse) { - requests.add(request); - responseObserver.onNext(((StreamBlurbsResponse) 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 StreamBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver sendBlurbs( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(CreateBlurbRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof SendBlurbsResponse) { - responseObserver.onNext(((SendBlurbsResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method SendBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - SendBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public StreamObserver connect( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(ConnectRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamBlurbsResponse) { - responseObserver.onNext(((StreamBlurbsResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Connect, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceService.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceService.java deleted file mode 100644 index 6e7db409ff..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSequenceService implements MockGrpcService { - private final MockSequenceServiceImpl serviceImpl; - - public MockSequenceService() { - serviceImpl = new MockSequenceServiceImpl(); - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceServiceImpl.java deleted file mode 100644 index a529856c95..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockSequenceServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.SequenceServiceGrpc.SequenceServiceImplBase; -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 MockSequenceServiceImpl extends SequenceServiceImplBase { - private List requests; - private Queue responses; - - public MockSequenceServiceImpl() { - 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 createSequence( - CreateSequenceRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Sequence) { - requests.add(request); - responseObserver.onNext(((Sequence) 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 CreateSequence, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Sequence.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSequenceReport( - GetSequenceReportRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof SequenceReport) { - requests.add(request); - responseObserver.onNext(((SequenceReport) 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 GetSequenceReport, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - SequenceReport.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void attemptSequence( - AttemptSequenceRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) 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 AttemptSequence, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTesting.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTesting.java deleted file mode 100644 index 07bf673623..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTesting.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockTesting implements MockGrpcService { - private final MockTestingImpl serviceImpl; - - public MockTesting() { - serviceImpl = new MockTestingImpl(); - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTestingImpl.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTestingImpl.java deleted file mode 100644 index 8bc492536e..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/MockTestingImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.TestingGrpc.TestingImplBase; -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 MockTestingImpl extends TestingImplBase { - private List requests; - private Queue responses; - - public MockTestingImpl() { - 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 createSession( - CreateSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Session) { - requests.add(request); - responseObserver.onNext(((Session) 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 CreateSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Session.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSession(GetSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Session) { - requests.add(request); - responseObserver.onNext(((Session) 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 GetSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Session.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listSessions( - ListSessionsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListSessionsResponse) { - requests.add(request); - responseObserver.onNext(((ListSessionsResponse) 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 ListSessions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListSessionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteSession(DeleteSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) 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 DeleteSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void reportSession( - ReportSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ReportSessionResponse) { - requests.add(request); - responseObserver.onNext(((ReportSessionResponse) 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 ReportSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ReportSessionResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listTests( - ListTestsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListTestsResponse) { - requests.add(request); - responseObserver.onNext(((ListTestsResponse) 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 ListTests, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListTestsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteTest(DeleteTestRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) 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 DeleteTest, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void verifyTest( - VerifyTestRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof VerifyTestResponse) { - requests.add(request); - responseObserver.onNext(((VerifyTestResponse) 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 VerifyTest, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - VerifyTestResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ProfileName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ProfileName.java deleted file mode 100644 index b69500d0ae..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/ProfileName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 ProfileName implements ResourceName { - private static final PathTemplate USER = - PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); - private volatile Map fieldValuesMap; - private final String user; - - @Deprecated - protected ProfileName() { - user = null; - } - - private ProfileName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - } - - public String getUser() { - return user; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ProfileName of(String user) { - return newBuilder().setUser(user).build(); - } - - public static String format(String user) { - return newBuilder().setUser(user).build().toString(); - } - - public static ProfileName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - USER.validatedMatch( - formattedString, "ProfileName.parse: formattedString not in valid format"); - return of(matchMap.get("user")); - } - - 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 (ProfileName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return USER.instantiate("user", user); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ProfileName that = ((ProfileName) o); - return Objects.equals(this.user, that.user); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(user); - return h; - } - - /** Builder for users/{user}/profile/blurbs. */ - public static class Builder { - private String user; - - protected Builder() {} - - public String getUser() { - return user; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - private Builder(ProfileName profileName) { - this.user = profileName.user; - } - - public ProfileName build() { - return new ProfileName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/RoomName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/RoomName.java deleted file mode 100644 index b7ebbbad5d..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/RoomName.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 RoomName implements ResourceName { - private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); - private volatile Map fieldValuesMap; - private final String room; - - @Deprecated - protected RoomName() { - room = null; - } - - private RoomName(Builder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - } - - public String getRoom() { - return room; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static RoomName of(String room) { - return newBuilder().setRoom(room).build(); - } - - public static String format(String room) { - return newBuilder().setRoom(room).build().toString(); - } - - public static RoomName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); - return of(matchMap.get("room")); - } - - 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 (RoomName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return ROOM.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (room != null) { - fieldMapBuilder.put("room", room); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return ROOM.instantiate("room", room); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - RoomName that = ((RoomName) o); - return Objects.equals(this.room, that.room); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(room); - return h; - } - - /** Builder for rooms/{room}. */ - public static class Builder { - private String room; - - protected Builder() {} - - public String getRoom() { - return room; - } - - public Builder setRoom(String room) { - this.room = room; - return this; - } - - private Builder(RoomName roomName) { - this.room = roomName.room; - } - - public RoomName build() { - return new RoomName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceName.java deleted file mode 100644 index 067bb15adb..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 SequenceName implements ResourceName { - private static final PathTemplate SEQUENCE = - PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); - private volatile Map fieldValuesMap; - private final String sequence; - - @Deprecated - protected SequenceName() { - sequence = null; - } - - private SequenceName(Builder builder) { - sequence = Preconditions.checkNotNull(builder.getSequence()); - } - - public String getSequence() { - return sequence; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SequenceName of(String sequence) { - return newBuilder().setSequence(sequence).build(); - } - - public static String format(String sequence) { - return newBuilder().setSequence(sequence).build().toString(); - } - - public static SequenceName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SEQUENCE.validatedMatch( - formattedString, "SequenceName.parse: formattedString not in valid format"); - return of(matchMap.get("sequence")); - } - - 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 (SequenceName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SEQUENCE.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (sequence != null) { - fieldMapBuilder.put("sequence", sequence); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SEQUENCE.instantiate("sequence", sequence); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SequenceName that = ((SequenceName) o); - return Objects.equals(this.sequence, that.sequence); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(sequence); - return h; - } - - /** Builder for sequences/{sequence}. */ - public static class Builder { - private String sequence; - - protected Builder() {} - - public String getSequence() { - return sequence; - } - - public Builder setSequence(String sequence) { - this.sequence = sequence; - return this; - } - - private Builder(SequenceName sequenceName) { - this.sequence = sequenceName.sequence; - } - - public SequenceName build() { - return new SequenceName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceReportName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceReportName.java deleted file mode 100644 index 80742478a3..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceReportName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 SequenceReportName implements ResourceName { - private static final PathTemplate SEQUENCE = - PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); - private volatile Map fieldValuesMap; - private final String sequence; - - @Deprecated - protected SequenceReportName() { - sequence = null; - } - - private SequenceReportName(Builder builder) { - sequence = Preconditions.checkNotNull(builder.getSequence()); - } - - public String getSequence() { - return sequence; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SequenceReportName of(String sequence) { - return newBuilder().setSequence(sequence).build(); - } - - public static String format(String sequence) { - return newBuilder().setSequence(sequence).build().toString(); - } - - public static SequenceReportName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SEQUENCE.validatedMatch( - formattedString, "SequenceReportName.parse: formattedString not in valid format"); - return of(matchMap.get("sequence")); - } - - 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 (SequenceReportName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SEQUENCE.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (sequence != null) { - fieldMapBuilder.put("sequence", sequence); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SEQUENCE.instantiate("sequence", sequence); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SequenceReportName that = ((SequenceReportName) o); - return Objects.equals(this.sequence, that.sequence); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(sequence); - return h; - } - - /** Builder for sequences/{sequence}/sequenceReport. */ - public static class Builder { - private String sequence; - - protected Builder() {} - - public String getSequence() { - return sequence; - } - - public Builder setSequence(String sequence) { - this.sequence = sequence; - return this; - } - - private Builder(SequenceReportName sequenceReportName) { - this.sequence = sequenceReportName.sequence; - } - - public SequenceReportName build() { - return new SequenceReportName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClient.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClient.java deleted file mode 100644 index 3a5221b5ef..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClient.java +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.SequenceServiceStub; -import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * This class provides the ability to make remote calls to the backing service through method calls - * that map to API methods. Sample code to get started: - * - *
{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
- *   Sequence sequence = Sequence.newBuilder().build();
- *   Sequence response = sequenceServiceClient.createSequence(sequence);
- * }
- * }
- * - *

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

To customize credentials: - * - *

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

To customize the endpoint: - * - *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class SequenceServiceClient implements BackgroundResource { - private final SequenceServiceSettings settings; - private final SequenceServiceStub stub; - - /** Constructs an instance of SequenceServiceClient with default settings. */ - public static final SequenceServiceClient create() throws IOException { - return create(SequenceServiceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of SequenceServiceClient, 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 SequenceServiceClient create(SequenceServiceSettings settings) - throws IOException { - return new SequenceServiceClient(settings); - } - - /** - * Constructs an instance of SequenceServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer using create(SequenceServiceSettings). - */ - public static final SequenceServiceClient create(SequenceServiceStub stub) { - return new SequenceServiceClient(stub); - } - - /** - * Constructs an instance of SequenceServiceClient, 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 SequenceServiceClient(SequenceServiceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((SequenceServiceStubSettings) settings.getStubSettings()).createStub(); - } - - protected SequenceServiceClient(SequenceServiceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final SequenceServiceSettings getSettings() { - return settings; - } - - public SequenceServiceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   Sequence sequence = Sequence.newBuilder().build();
-   *   Sequence response = sequenceServiceClient.createSequence(sequence);
-   * }
-   * }
- * - * @param sequence - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Sequence createSequence(Sequence sequence) { - CreateSequenceRequest request = - CreateSequenceRequest.newBuilder().setSequence(sequence).build(); - return createSequence(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   CreateSequenceRequest request =
-   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
-   *   Sequence response = sequenceServiceClient.createSequence(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 Sequence createSequence(CreateSequenceRequest request) { - return createSequenceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a sequence. - * - *

Sample code: - * - *

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

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   SequenceReportName name = SequenceReportName.of("[SEQUENCE]");
-   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
-   * }
-   * }
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final SequenceReport getSequenceReport(SequenceReportName name) { - GetSequenceReportRequest request = - GetSequenceReportRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getSequenceReport(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   String name = SequenceReportName.of("[SEQUENCE]").toString();
-   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
-   * }
-   * }
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final SequenceReport getSequenceReport(String name) { - GetSequenceReportRequest request = GetSequenceReportRequest.newBuilder().setName(name).build(); - return getSequenceReport(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   GetSequenceReportRequest request =
-   *       GetSequenceReportRequest.newBuilder()
-   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
-   *           .build();
-   *   SequenceReport response = sequenceServiceClient.getSequenceReport(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 SequenceReport getSequenceReport(GetSequenceReportRequest request) { - return getSequenceReportCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   GetSequenceReportRequest request =
-   *       GetSequenceReportRequest.newBuilder()
-   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       sequenceServiceClient.getSequenceReportCallable().futureCall(request);
-   *   // Do something.
-   *   SequenceReport response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getSequenceReportCallable() { - return stub.getSequenceReportCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   SequenceName name = SequenceName.of("[SEQUENCE]");
-   *   sequenceServiceClient.attemptSequence(name);
-   * }
-   * }
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void attemptSequence(SequenceName name) { - AttemptSequenceRequest request = - AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - attemptSequence(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   String name = SequenceName.of("[SEQUENCE]").toString();
-   *   sequenceServiceClient.attemptSequence(name);
-   * }
-   * }
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void attemptSequence(String name) { - AttemptSequenceRequest request = AttemptSequenceRequest.newBuilder().setName(name).build(); - attemptSequence(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   AttemptSequenceRequest request =
-   *       AttemptSequenceRequest.newBuilder()
-   *           .setName(SequenceName.of("[SEQUENCE]").toString())
-   *           .build();
-   *   sequenceServiceClient.attemptSequence(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void attemptSequence(AttemptSequenceRequest request) { - attemptSequenceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
-   *   AttemptSequenceRequest request =
-   *       AttemptSequenceRequest.newBuilder()
-   *           .setName(SequenceName.of("[SEQUENCE]").toString())
-   *           .build();
-   *   ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable attemptSequenceCallable() { - return stub.attemptSequenceCallable(); - } - - @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); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java deleted file mode 100644 index 167002e8f2..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -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 SequenceServiceClientHttpJsonTest { - private static MockHttpService mockService; - private static SequenceServiceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonSequenceServiceStub.getMethodDescriptors(), - SequenceServiceSettings.getDefaultEndpoint()); - SequenceServiceSettings settings = - SequenceServiceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - SequenceServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SequenceServiceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createSequenceTest() throws Exception { - Sequence expectedResponse = - Sequence.newBuilder() - .setName(SequenceName.of("[SEQUENCE]").toString()) - .addAllResponses(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Sequence sequence = Sequence.newBuilder().build(); - - Sequence actualResponse = client.createSequence(sequence); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSequenceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Sequence sequence = Sequence.newBuilder().build(); - client.createSequence(sequence); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSequenceReportExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest2() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "sequences/sequence-5566/sequenceReport"; - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSequenceReportExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "sequences/sequence-5566/sequenceReport"; - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SequenceName name = SequenceName.of("[SEQUENCE]"); - - client.attemptSequence(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void attemptSequenceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SequenceName name = SequenceName.of("[SEQUENCE]"); - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "sequences/sequence-9950"; - - client.attemptSequence(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void attemptSequenceExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "sequences/sequence-9950"; - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientTest.java deleted file mode 100644 index 4b6f722827..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceClientTest.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SequenceServiceClientTest { - private static MockSequenceService mockSequenceService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private SequenceServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockSequenceService = new MockSequenceService(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockSequenceService)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - SequenceServiceSettings settings = - SequenceServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SequenceServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createSequenceTest() throws Exception { - Sequence expectedResponse = - Sequence.newBuilder() - .setName(SequenceName.of("[SEQUENCE]").toString()) - .addAllResponses(new ArrayList()) - .build(); - mockSequenceService.addResponse(expectedResponse); - - Sequence sequence = Sequence.newBuilder().build(); - - Sequence actualResponse = client.createSequence(sequence); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSequenceRequest actualRequest = ((CreateSequenceRequest) actualRequests.get(0)); - - Assert.assertEquals(sequence, actualRequest.getSequence()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSequenceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - Sequence sequence = Sequence.newBuilder().build(); - client.createSequence(sequence); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockSequenceService.addResponse(expectedResponse); - - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSequenceReportExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest2() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockSequenceService.addResponse(expectedResponse); - - String name = "name3373707"; - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSequenceReportExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - String name = "name3373707"; - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSequenceService.addResponse(expectedResponse); - - SequenceName name = SequenceName.of("[SEQUENCE]"); - - client.attemptSequence(name); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void attemptSequenceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - SequenceName name = SequenceName.of("[SEQUENCE]"); - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSequenceService.addResponse(expectedResponse); - - String name = "name3373707"; - - client.attemptSequence(name); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void attemptSequenceExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - String name = "name3373707"; - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceSettings.java deleted file mode 100644 index 7b6225a1ee..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SequenceServiceSettings.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; -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 SequenceServiceClient}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createSequence to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SequenceServiceSettings.Builder sequenceServiceSettingsBuilder =
- *     SequenceServiceSettings.newBuilder();
- * sequenceServiceSettingsBuilder
- *     .createSequenceSettings()
- *     .setRetrySettings(
- *         sequenceServiceSettingsBuilder
- *             .createSequenceSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class SequenceServiceSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createSequence. */ - public UnaryCallSettings createSequenceSettings() { - return ((SequenceServiceStubSettings) getStubSettings()).createSequenceSettings(); - } - - /** Returns the object with the settings used for calls to getSequenceReport. */ - public UnaryCallSettings getSequenceReportSettings() { - return ((SequenceServiceStubSettings) getStubSettings()).getSequenceReportSettings(); - } - - /** Returns the object with the settings used for calls to attemptSequence. */ - public UnaryCallSettings attemptSequenceSettings() { - return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); - } - - public static final SequenceServiceSettings create(SequenceServiceStubSettings stub) - throws IOException { - return new SequenceServiceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SequenceServiceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SequenceServiceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SequenceServiceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SequenceServiceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SequenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return SequenceServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SequenceServiceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SequenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SequenceServiceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SequenceServiceSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(SequenceServiceStubSettings.newBuilder(clientContext)); - } - - protected Builder(SequenceServiceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SequenceServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(SequenceServiceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(SequenceServiceStubSettings.newHttpJsonBuilder()); - } - - public SequenceServiceStubSettings.Builder getStubSettingsBuilder() { - return ((SequenceServiceStubSettings.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 createSequence. */ - public UnaryCallSettings.Builder createSequenceSettings() { - return getStubSettingsBuilder().createSequenceSettings(); - } - - /** Returns the builder for the settings used for calls to getSequenceReport. */ - public UnaryCallSettings.Builder - getSequenceReportSettings() { - return getStubSettingsBuilder().getSequenceReportSettings(); - } - - /** Returns the builder for the settings used for calls to attemptSequence. */ - public UnaryCallSettings.Builder attemptSequenceSettings() { - return getStubSettingsBuilder().attemptSequenceSettings(); - } - - @Override - public SequenceServiceSettings build() throws IOException { - return new SequenceServiceSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SessionName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SessionName.java deleted file mode 100644 index a205c1272d..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/SessionName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 SessionName implements ResourceName { - private static final PathTemplate SESSION = - PathTemplate.createWithoutUrlEncoding("sessions/{session}"); - private volatile Map fieldValuesMap; - private final String session; - - @Deprecated - protected SessionName() { - session = null; - } - - private SessionName(Builder builder) { - session = Preconditions.checkNotNull(builder.getSession()); - } - - public String getSession() { - return session; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SessionName of(String session) { - return newBuilder().setSession(session).build(); - } - - public static String format(String session) { - return newBuilder().setSession(session).build().toString(); - } - - public static SessionName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SESSION.validatedMatch( - formattedString, "SessionName.parse: formattedString not in valid format"); - return of(matchMap.get("session")); - } - - 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 (SessionName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SESSION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (session != null) { - fieldMapBuilder.put("session", session); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SESSION.instantiate("session", session); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionName that = ((SessionName) o); - return Objects.equals(this.session, that.session); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(session); - return h; - } - - /** Builder for sessions/{session}. */ - public static class Builder { - private String session; - - protected Builder() {} - - public String getSession() { - return session; - } - - public Builder setSession(String session) { - this.session = session; - return this; - } - - private Builder(SessionName sessionName) { - this.session = sessionName.session; - } - - public SessionName build() { - return new SessionName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestName.java deleted file mode 100644 index fb2855113a..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestName.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 TestName implements ResourceName { - private static final PathTemplate SESSION_TEST = - PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); - private volatile Map fieldValuesMap; - private final String session; - private final String test; - - @Deprecated - protected TestName() { - session = null; - test = null; - } - - private TestName(Builder builder) { - session = Preconditions.checkNotNull(builder.getSession()); - test = Preconditions.checkNotNull(builder.getTest()); - } - - public String getSession() { - return session; - } - - public String getTest() { - return test; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static TestName of(String session, String test) { - return newBuilder().setSession(session).setTest(test).build(); - } - - public static String format(String session, String test) { - return newBuilder().setSession(session).setTest(test).build().toString(); - } - - public static TestName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SESSION_TEST.validatedMatch( - formattedString, "TestName.parse: formattedString not in valid format"); - return of(matchMap.get("session"), matchMap.get("test")); - } - - 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 (TestName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SESSION_TEST.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (session != null) { - fieldMapBuilder.put("session", session); - } - if (test != null) { - fieldMapBuilder.put("test", test); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SESSION_TEST.instantiate("session", session, "test", test); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - TestName that = ((TestName) o); - return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(test); - return h; - } - - /** Builder for sessions/{session}/tests/{test}. */ - public static class Builder { - private String session; - private String test; - - protected Builder() {} - - public String getSession() { - return session; - } - - public String getTest() { - return test; - } - - public Builder setSession(String session) { - this.session = session; - return this; - } - - public Builder setTest(String test) { - this.test = test; - return this; - } - - private Builder(TestName testName) { - this.session = testName.session; - this.test = testName.test; - } - - public TestName build() { - return new TestName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClient.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClient.java deleted file mode 100644 index 9cf8b16a13..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClient.java +++ /dev/null @@ -1,880 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.TestingStub; -import com.google.showcase.v1beta1.stub.TestingStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: A service to facilitate running discrete sets of tests against Showcase. - * - *

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

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

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

To customize credentials: - * - *

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

To customize the endpoint: - * - *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class TestingClient implements BackgroundResource { - private final TestingSettings settings; - private final TestingStub stub; - - /** Constructs an instance of TestingClient with default settings. */ - public static final TestingClient create() throws IOException { - return create(TestingSettings.newBuilder().build()); - } - - /** - * Constructs an instance of TestingClient, 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 TestingClient create(TestingSettings settings) throws IOException { - return new TestingClient(settings); - } - - /** - * Constructs an instance of TestingClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(TestingSettings). - */ - public static final TestingClient create(TestingStub stub) { - return new TestingClient(stub); - } - - /** - * Constructs an instance of TestingClient, 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 TestingClient(TestingSettings settings) throws IOException { - this.settings = settings; - this.stub = ((TestingStubSettings) settings.getStubSettings()).createStub(); - } - - protected TestingClient(TestingStub stub) { - this.settings = null; - this.stub = stub; - } - - public final TestingSettings getSettings() { - return settings; - } - - public TestingStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new testing session. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   CreateSessionRequest request =
-   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
-   *   Session response = testingClient.createSession(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 Session createSession(CreateSessionRequest request) { - return createSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new testing session. - * - *

Sample code: - * - *

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

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   GetSessionRequest request =
-   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
-   *   Session response = testingClient.getSession(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 Session getSession(GetSessionRequest request) { - return getSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets a testing session. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   GetSessionRequest request =
-   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
-   *   ApiFuture future = testingClient.getSessionCallable().futureCall(request);
-   *   // Do something.
-   *   Session response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getSessionCallable() { - return stub.getSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the current test sessions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ListSessionsRequest request =
-   *       ListSessionsRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Session element : testingClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { - return listSessionsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the current test sessions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ListSessionsRequest request =
-   *       ListSessionsRequest.newBuilder()
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Session element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listSessionsPagedCallable() { - return stub.listSessionsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the current test sessions. - * - *

Sample code: - * - *

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

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   DeleteSessionRequest request =
-   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
-   *   testingClient.deleteSession(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteSession(DeleteSessionRequest request) { - deleteSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a test session. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   DeleteSessionRequest request =
-   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
-   *   ApiFuture future = testingClient.deleteSessionCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteSessionCallable() { - return stub.deleteSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Report on the status of a session. This generates a report detailing which tests have been - * completed, and an overall rollup. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ReportSessionRequest request =
-   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
-   *   ReportSessionResponse response = testingClient.reportSession(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 ReportSessionResponse reportSession(ReportSessionRequest request) { - return reportSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Report on the status of a session. This generates a report detailing which tests have been - * completed, and an overall rollup. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ReportSessionRequest request =
-   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
-   *   ApiFuture future =
-   *       testingClient.reportSessionCallable().futureCall(request);
-   *   // Do something.
-   *   ReportSessionResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable reportSessionCallable() { - return stub.reportSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List the tests of a sessesion. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ListTestsRequest request =
-   *       ListTestsRequest.newBuilder()
-   *           .setParent(SessionName.of("[SESSION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Test element : testingClient.listTests(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 ListTestsPagedResponse listTests(ListTestsRequest request) { - return listTestsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List the tests of a sessesion. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ListTestsRequest request =
-   *       ListTestsRequest.newBuilder()
-   *           .setParent(SessionName.of("[SESSION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Test element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listTestsPagedCallable() { - return stub.listTestsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List the tests of a sessesion. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   ListTestsRequest request =
-   *       ListTestsRequest.newBuilder()
-   *           .setParent(SessionName.of("[SESSION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListTestsResponse response = testingClient.listTestsCallable().call(request);
-   *     for (Test element : response.getTestsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listTestsCallable() { - return stub.listTestsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Explicitly decline to implement a test. - * - *

This removes the test from subsequent `ListTests` calls, and attempting to do the test will - * error. - * - *

This method will error if attempting to delete a required test. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   DeleteTestRequest request =
-   *       DeleteTestRequest.newBuilder()
-   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
-   *           .build();
-   *   testingClient.deleteTest(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteTest(DeleteTestRequest request) { - deleteTestCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Explicitly decline to implement a test. - * - *

This removes the test from subsequent `ListTests` calls, and attempting to do the test will - * error. - * - *

This method will error if attempting to delete a required test. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   DeleteTestRequest request =
-   *       DeleteTestRequest.newBuilder()
-   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
-   *           .build();
-   *   ApiFuture future = testingClient.deleteTestCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteTestCallable() { - return stub.deleteTestCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Register a response to a test. - * - *

In cases where a test involves registering a final answer at the end of the test, this - * method provides the means to do so. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   VerifyTestRequest request =
-   *       VerifyTestRequest.newBuilder()
-   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
-   *           .setAnswer(ByteString.EMPTY)
-   *           .addAllAnswers(new ArrayList())
-   *           .build();
-   *   VerifyTestResponse response = testingClient.verifyTest(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 VerifyTestResponse verifyTest(VerifyTestRequest request) { - return verifyTestCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Register a response to a test. - * - *

In cases where a test involves registering a final answer at the end of the test, this - * method provides the means to do so. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TestingClient testingClient = TestingClient.create()) {
-   *   VerifyTestRequest request =
-   *       VerifyTestRequest.newBuilder()
-   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
-   *           .setAnswer(ByteString.EMPTY)
-   *           .addAllAnswers(new ArrayList())
-   *           .build();
-   *   ApiFuture future = testingClient.verifyTestCallable().futureCall(request);
-   *   // Do something.
-   *   VerifyTestResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable verifyTestCallable() { - return stub.verifyTestCallable(); - } - - @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 ListSessionsPagedResponse - extends AbstractPagedListResponse< - ListSessionsRequest, - ListSessionsResponse, - Session, - ListSessionsPage, - ListSessionsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListSessionsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListSessionsPagedResponse(ListSessionsPage page) { - super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListSessionsPage - extends AbstractPage { - - private ListSessionsPage( - PageContext context, - ListSessionsResponse response) { - super(context, response); - } - - private static ListSessionsPage createEmptyPage() { - return new ListSessionsPage(null, null); - } - - @Override - protected ListSessionsPage createPage( - PageContext context, - ListSessionsResponse response) { - return new ListSessionsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListSessionsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListSessionsRequest, - ListSessionsResponse, - Session, - ListSessionsPage, - ListSessionsFixedSizeCollection> { - - private ListSessionsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListSessionsFixedSizeCollection createEmptyCollection() { - return new ListSessionsFixedSizeCollection(null, 0); - } - - @Override - protected ListSessionsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListSessionsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListTestsPagedResponse - extends AbstractPagedListResponse< - ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListTestsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListTestsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListTestsPagedResponse(ListTestsPage page) { - super(page, ListTestsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListTestsPage - extends AbstractPage { - - private ListTestsPage( - PageContext context, - ListTestsResponse response) { - super(context, response); - } - - private static ListTestsPage createEmptyPage() { - return new ListTestsPage(null, null); - } - - @Override - protected ListTestsPage createPage( - PageContext context, - ListTestsResponse response) { - return new ListTestsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListTestsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { - - private ListTestsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListTestsFixedSizeCollection createEmptyCollection() { - return new ListTestsFixedSizeCollection(null, 0); - } - - @Override - protected ListTestsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListTestsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java deleted file mode 100644 index b16824b565..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java +++ /dev/null @@ -1,472 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -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 TestingClientHttpJsonTest { - private static MockHttpService mockService; - private static TestingClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonTestingStub.getMethodDescriptors(), TestingSettings.getDefaultEndpoint()); - TestingSettings settings = - TestingSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - TestingSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TestingClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockService.addResponse(expectedResponse); - - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - - Session actualResponse = client.createSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - client.createSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockService.addResponse(expectedResponse); - - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - Session actualResponse = client.getSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.getSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSessionsTest() throws Exception { - Session responsesElement = Session.newBuilder().build(); - ListSessionsResponse expectedResponse = - ListSessionsResponse.newBuilder() - .setNextPageToken("") - .addAllSessions(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListSessionsPagedResponse pagedListResponse = client.listSessions(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSessionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listSessions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSessionTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - client.deleteSession(request); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.deleteSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void reportSessionTest() throws Exception { - ReportSessionResponse expectedResponse = - ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - ReportSessionResponse actualResponse = client.reportSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void reportSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.reportSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTestsTest() throws Exception { - com.google.showcase.v1beta1.Test responsesElement = - com.google.showcase.v1beta1.Test.newBuilder().build(); - ListTestsResponse expectedResponse = - ListTestsResponse.newBuilder() - .setNextPageToken("") - .addAllTests(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListTestsPagedResponse pagedListResponse = client.listTests(request); - - List resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTestsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listTests(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTestTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - - client.deleteTest(request); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteTestExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - client.deleteTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyTestTest() throws Exception { - VerifyTestResponse expectedResponse = - VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); - mockService.addResponse(expectedResponse); - - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - - VerifyTestResponse actualResponse = client.verifyTest(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void verifyTestExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - client.verifyTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientTest.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientTest.java deleted file mode 100644 index 27ac6b9632..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingClientTest.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -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.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class TestingClientTest { - private static MockServiceHelper mockServiceHelper; - private static MockTesting mockTesting; - private LocalChannelProvider channelProvider; - private TestingClient client; - - @BeforeClass - public static void startStaticServer() { - mockTesting = new MockTesting(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockTesting)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - TestingSettings settings = - TestingSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TestingClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockTesting.addResponse(expectedResponse); - - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - - Session actualResponse = client.createSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getSession(), actualRequest.getSession()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - client.createSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockTesting.addResponse(expectedResponse); - - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - Session actualResponse = client.getSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.getSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSessionsTest() throws Exception { - Session responsesElement = Session.newBuilder().build(); - ListSessionsResponse expectedResponse = - ListSessionsResponse.newBuilder() - .setNextPageToken("") - .addAllSessions(Arrays.asList(responsesElement)) - .build(); - mockTesting.addResponse(expectedResponse); - - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListSessionsPagedResponse pagedListResponse = client.listSessions(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListSessionsRequest actualRequest = ((ListSessionsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSessionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listSessions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSessionTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockTesting.addResponse(expectedResponse); - - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - client.deleteSession(request); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.deleteSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void reportSessionTest() throws Exception { - ReportSessionResponse expectedResponse = - ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); - mockTesting.addResponse(expectedResponse); - - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - ReportSessionResponse actualResponse = client.reportSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ReportSessionRequest actualRequest = ((ReportSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void reportSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.reportSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTestsTest() throws Exception { - com.google.showcase.v1beta1.Test responsesElement = - com.google.showcase.v1beta1.Test.newBuilder().build(); - ListTestsResponse expectedResponse = - ListTestsResponse.newBuilder() - .setNextPageToken("") - .addAllTests(Arrays.asList(responsesElement)) - .build(); - mockTesting.addResponse(expectedResponse); - - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListTestsPagedResponse pagedListResponse = client.listTests(request); - - List resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTestsRequest actualRequest = ((ListTestsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getParent(), actualRequest.getParent()); - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTestsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listTests(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTestTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockTesting.addResponse(expectedResponse); - - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - - client.deleteTest(request); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteTestRequest actualRequest = ((DeleteTestRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteTestExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - client.deleteTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyTestTest() throws Exception { - VerifyTestResponse expectedResponse = - VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); - mockTesting.addResponse(expectedResponse); - - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - - VerifyTestResponse actualResponse = client.verifyTest(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - VerifyTestRequest actualRequest = ((VerifyTestRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getAnswer(), actualRequest.getAnswer()); - Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void verifyTestExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - client.verifyTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingSettings.java deleted file mode 100644 index 0a59e67a92..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/TestingSettings.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.TestingStubSettings; -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 TestingClient}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createSession to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder();
- * testingSettingsBuilder
- *     .createSessionSettings()
- *     .setRetrySettings(
- *         testingSettingsBuilder
- *             .createSessionSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * TestingSettings testingSettings = testingSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class TestingSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createSession. */ - public UnaryCallSettings createSessionSettings() { - return ((TestingStubSettings) getStubSettings()).createSessionSettings(); - } - - /** Returns the object with the settings used for calls to getSession. */ - public UnaryCallSettings getSessionSettings() { - return ((TestingStubSettings) getStubSettings()).getSessionSettings(); - } - - /** Returns the object with the settings used for calls to listSessions. */ - public PagedCallSettings - listSessionsSettings() { - return ((TestingStubSettings) getStubSettings()).listSessionsSettings(); - } - - /** Returns the object with the settings used for calls to deleteSession. */ - public UnaryCallSettings deleteSessionSettings() { - return ((TestingStubSettings) getStubSettings()).deleteSessionSettings(); - } - - /** Returns the object with the settings used for calls to reportSession. */ - public UnaryCallSettings reportSessionSettings() { - return ((TestingStubSettings) getStubSettings()).reportSessionSettings(); - } - - /** Returns the object with the settings used for calls to listTests. */ - public PagedCallSettings - listTestsSettings() { - return ((TestingStubSettings) getStubSettings()).listTestsSettings(); - } - - /** Returns the object with the settings used for calls to deleteTest. */ - public UnaryCallSettings deleteTestSettings() { - return ((TestingStubSettings) getStubSettings()).deleteTestSettings(); - } - - /** Returns the object with the settings used for calls to verifyTest. */ - public UnaryCallSettings verifyTestSettings() { - return ((TestingStubSettings) getStubSettings()).verifyTestSettings(); - } - - public static final TestingSettings create(TestingStubSettings stub) throws IOException { - return new TestingSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return TestingStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return TestingStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return TestingStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return TestingStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return TestingStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return TestingStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return TestingStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return TestingStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected TestingSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for TestingSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(TestingStubSettings.newBuilder(clientContext)); - } - - protected Builder(TestingSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(TestingStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(TestingStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(TestingStubSettings.newHttpJsonBuilder()); - } - - public TestingStubSettings.Builder getStubSettingsBuilder() { - return ((TestingStubSettings.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 createSession. */ - public UnaryCallSettings.Builder createSessionSettings() { - return getStubSettingsBuilder().createSessionSettings(); - } - - /** Returns the builder for the settings used for calls to getSession. */ - public UnaryCallSettings.Builder getSessionSettings() { - return getStubSettingsBuilder().getSessionSettings(); - } - - /** Returns the builder for the settings used for calls to listSessions. */ - public PagedCallSettings.Builder< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings() { - return getStubSettingsBuilder().listSessionsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteSession. */ - public UnaryCallSettings.Builder deleteSessionSettings() { - return getStubSettingsBuilder().deleteSessionSettings(); - } - - /** Returns the builder for the settings used for calls to reportSession. */ - public UnaryCallSettings.Builder - reportSessionSettings() { - return getStubSettingsBuilder().reportSessionSettings(); - } - - /** Returns the builder for the settings used for calls to listTests. */ - public PagedCallSettings.Builder - listTestsSettings() { - return getStubSettingsBuilder().listTestsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteTest. */ - public UnaryCallSettings.Builder deleteTestSettings() { - return getStubSettingsBuilder().deleteTestSettings(); - } - - /** Returns the builder for the settings used for calls to verifyTest. */ - public UnaryCallSettings.Builder verifyTestSettings() { - return getStubSettingsBuilder().verifyTestSettings(); - } - - @Override - public TestingSettings build() throws IOException { - return new TestingSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/UserName.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/UserName.java deleted file mode 100644 index df5a3618b7..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/UserName.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -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 UserName implements ResourceName { - private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); - private volatile Map fieldValuesMap; - private final String user; - - @Deprecated - protected UserName() { - user = null; - } - - private UserName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - } - - public String getUser() { - return user; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static UserName of(String user) { - return newBuilder().setUser(user).build(); - } - - public static String format(String user) { - return newBuilder().setUser(user).build().toString(); - } - - public static UserName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); - return of(matchMap.get("user")); - } - - 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 (UserName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return USER.instantiate("user", user); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - UserName that = ((UserName) o); - return Objects.equals(this.user, that.user); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(user); - return h; - } - - /** Builder for users/{user}. */ - public static class Builder { - private String user; - - protected Builder() {} - - public String getUser() { - return user; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - private Builder(UserName userName) { - this.user = userName.user; - } - - public UserName build() { - return new UserName(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/gapic_metadata.json b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/gapic_metadata.json deleted file mode 100644 index 31f51f17ef..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.showcase.v1beta1", - "libraryPackage": "com.google.showcase.v1beta1", - "services": { - "Compliance": { - "clients": { - "grpc": { - "libraryClient": "ComplianceClient", - "rpcs": { - "GetEnum": { - "methods": ["getEnum", "getEnumCallable"] - }, - "RepeatDataBody": { - "methods": ["repeatDataBody", "repeatDataBodyCallable"] - }, - "RepeatDataBodyInfo": { - "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] - }, - "RepeatDataBodyPatch": { - "methods": ["repeatDataBodyPatch", "repeatDataBodyPatchCallable"] - }, - "RepeatDataBodyPut": { - "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] - }, - "RepeatDataPathResource": { - "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] - }, - "RepeatDataPathTrailingResource": { - "methods": ["repeatDataPathTrailingResource", "repeatDataPathTrailingResourceCallable"] - }, - "RepeatDataQuery": { - "methods": ["repeatDataQuery", "repeatDataQueryCallable"] - }, - "RepeatDataSimplePath": { - "methods": ["repeatDataSimplePath", "repeatDataSimplePathCallable"] - }, - "VerifyEnum": { - "methods": ["verifyEnum", "verifyEnumCallable"] - } - } - } - } - }, - "Echo": { - "clients": { - "grpc": { - "libraryClient": "EchoClient", - "rpcs": { - "Block": { - "methods": ["block", "blockCallable"] - }, - "Chat": { - "methods": ["chatCallable"] - }, - "Collect": { - "methods": ["collectCallable"] - }, - "Echo": { - "methods": ["echo", "echoCallable"] - }, - "Expand": { - "methods": ["expandCallable"] - }, - "PagedExpand": { - "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] - }, - "PagedExpandLegacy": { - "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] - }, - "PagedExpandLegacyMapped": { - "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] - }, - "Wait": { - "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] - } - } - } - } - }, - "Identity": { - "clients": { - "grpc": { - "libraryClient": "IdentityClient", - "rpcs": { - "CreateUser": { - "methods": ["createUser", "createUser", "createUser", "createUserCallable"] - }, - "DeleteUser": { - "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] - }, - "GetUser": { - "methods": ["getUser", "getUser", "getUser", "getUserCallable"] - }, - "ListUsers": { - "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] - }, - "UpdateUser": { - "methods": ["updateUser", "updateUserCallable"] - } - } - } - } - }, - "Messaging": { - "clients": { - "grpc": { - "libraryClient": "MessagingClient", - "rpcs": { - "Connect": { - "methods": ["connectCallable"] - }, - "CreateBlurb": { - "methods": ["createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurbCallable"] - }, - "CreateRoom": { - "methods": ["createRoom", "createRoom", "createRoomCallable"] - }, - "DeleteBlurb": { - "methods": ["deleteBlurb", "deleteBlurb", "deleteBlurb", "deleteBlurbCallable"] - }, - "DeleteRoom": { - "methods": ["deleteRoom", "deleteRoom", "deleteRoom", "deleteRoomCallable"] - }, - "GetBlurb": { - "methods": ["getBlurb", "getBlurb", "getBlurb", "getBlurbCallable"] - }, - "GetRoom": { - "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] - }, - "ListBlurbs": { - "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] - }, - "ListRooms": { - "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] - }, - "SearchBlurbs": { - "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] - }, - "SendBlurbs": { - "methods": ["sendBlurbsCallable"] - }, - "StreamBlurbs": { - "methods": ["streamBlurbsCallable"] - }, - "UpdateBlurb": { - "methods": ["updateBlurb", "updateBlurbCallable"] - }, - "UpdateRoom": { - "methods": ["updateRoom", "updateRoomCallable"] - } - } - } - } - }, - "SequenceService": { - "clients": { - "grpc": { - "libraryClient": "SequenceServiceClient", - "rpcs": { - "AttemptSequence": { - "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] - }, - "CreateSequence": { - "methods": ["createSequence", "createSequence", "createSequenceCallable"] - }, - "GetSequenceReport": { - "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] - } - } - } - } - }, - "Testing": { - "clients": { - "grpc": { - "libraryClient": "TestingClient", - "rpcs": { - "CreateSession": { - "methods": ["createSession", "createSessionCallable"] - }, - "DeleteSession": { - "methods": ["deleteSession", "deleteSessionCallable"] - }, - "DeleteTest": { - "methods": ["deleteTest", "deleteTestCallable"] - }, - "GetSession": { - "methods": ["getSession", "getSessionCallable"] - }, - "ListSessions": { - "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] - }, - "ListTests": { - "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] - }, - "ReportSession": { - "methods": ["reportSession", "reportSessionCallable"] - }, - "VerifyTest": { - "methods": ["verifyTest", "verifyTestCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/package-info.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/package-info.java deleted file mode 100644 index be1926a090..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/package-info.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * A client to Client Libraries Showcase API - * - *

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

======================= ComplianceClient ======================= - * - *

Service Description: This service is used to test that GAPICs implement various REST-related - * features correctly. This mostly means transcoding proto3 requests to REST format correctly for - * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums - * received by clients can be round-tripped correctly. - * - *

Sample for ComplianceClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (ComplianceClient complianceClient = ComplianceClient.create()) {
- *   RepeatRequest request =
- *       RepeatRequest.newBuilder()
- *           .setName("name3373707")
- *           .setInfo(ComplianceData.newBuilder().build())
- *           .setServerVerify(true)
- *           .setIntendedBindingUri("intendedBindingUri780142386")
- *           .setFInt32(-1143775883)
- *           .setFInt64(-1143775788)
- *           .setFDouble(-1239459382)
- *           .setPInt32(-858673665)
- *           .setPInt64(-858673570)
- *           .setPDouble(-991225216)
- *           .build();
- *   RepeatResponse response = complianceClient.repeatDataBody(request);
- * }
- * }
- * - *

======================= EchoClient ======================= - * - *

Service Description: This service is used showcase the four main types of rpcs - unary, server - * side streaming, client side streaming, and bidirectional streaming. This service also exposes - * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' - * metadata key on any method to have the values echoed in the response trailers. Set the - * 'x-goog-request-params' metadata key on any method to have the values echoed in the response - * headers. - * - *

Sample for EchoClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (EchoClient echoClient = EchoClient.create()) {
- *   EchoRequest request =
- *       EchoRequest.newBuilder()
- *           .setSeverity(Severity.forNumber(0))
- *           .setHeader("header-1221270899")
- *           .setOtherHeader("otherHeader-2026585667")
- *           .build();
- *   EchoResponse response = echoClient.echo(request);
- * }
- * }
- * - *

======================= IdentityClient ======================= - * - *

Service Description: A simple identity service. - * - *

Sample for IdentityClient: - * - *

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

======================= MessagingClient ======================= - * - *

Service Description: A simple messaging service that implements chat rooms and profile posts. - * - *

This messaging service showcases the features that API clients generated by gapic-generators - * implement. - * - *

Sample for MessagingClient: - * - *

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

======================= SequenceServiceClient ======================= - * - *

Sample for SequenceServiceClient: - * - *

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

======================= TestingClient ======================= - * - *

Service Description: A service to facilitate running discrete sets of tests against Showcase. - * - *

Sample for TestingClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (TestingClient testingClient = TestingClient.create()) {
- *   CreateSessionRequest request =
- *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
- *   Session response = testingClient.createSession(request);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.showcase.v1beta1; - -import javax.annotation.Generated; diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStub.java deleted file mode 100644 index c4f54eb557..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStub.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Compliance service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class ComplianceStub implements BackgroundResource { - - public UnaryCallable repeatDataBodyCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyCallable()"); - } - - public UnaryCallable repeatDataBodyInfoCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyInfoCallable()"); - } - - public UnaryCallable repeatDataQueryCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataQueryCallable()"); - } - - public UnaryCallable repeatDataSimplePathCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataSimplePathCallable()"); - } - - public UnaryCallable repeatDataPathResourceCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataPathResourceCallable()"); - } - - public UnaryCallable repeatDataPathTrailingResourceCallable() { - throw new UnsupportedOperationException( - "Not implemented: repeatDataPathTrailingResourceCallable()"); - } - - public UnaryCallable repeatDataBodyPutCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyPutCallable()"); - } - - public UnaryCallable repeatDataBodyPatchCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyPatchCallable()"); - } - - public UnaryCallable getEnumCallable() { - throw new UnsupportedOperationException("Not implemented: getEnumCallable()"); - } - - public UnaryCallable verifyEnumCallable() { - throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java deleted file mode 100644 index 67b16b6fac..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ /dev/null @@ -1,526 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.ApiFunction; -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -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.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -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 ComplianceStub}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 repeatDataBody to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder();
- * complianceSettingsBuilder
- *     .repeatDataBodySettings()
- *     .setRetrySettings(
- *         complianceSettingsBuilder
- *             .repeatDataBodySettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class ComplianceStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings repeatDataBodySettings; - private final UnaryCallSettings repeatDataBodyInfoSettings; - private final UnaryCallSettings repeatDataQuerySettings; - private final UnaryCallSettings repeatDataSimplePathSettings; - private final UnaryCallSettings repeatDataPathResourceSettings; - private final UnaryCallSettings - repeatDataPathTrailingResourceSettings; - private final UnaryCallSettings repeatDataBodyPutSettings; - private final UnaryCallSettings repeatDataBodyPatchSettings; - private final UnaryCallSettings getEnumSettings; - private final UnaryCallSettings verifyEnumSettings; - - /** Returns the object with the settings used for calls to repeatDataBody. */ - public UnaryCallSettings repeatDataBodySettings() { - return repeatDataBodySettings; - } - - /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings repeatDataBodyInfoSettings() { - return repeatDataBodyInfoSettings; - } - - /** Returns the object with the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings repeatDataQuerySettings() { - return repeatDataQuerySettings; - } - - /** Returns the object with the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings repeatDataSimplePathSettings() { - return repeatDataSimplePathSettings; - } - - /** Returns the object with the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings repeatDataPathResourceSettings() { - return repeatDataPathResourceSettings; - } - - /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings repeatDataPathTrailingResourceSettings() { - return repeatDataPathTrailingResourceSettings; - } - - /** Returns the object with the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings repeatDataBodyPutSettings() { - return repeatDataBodyPutSettings; - } - - /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings repeatDataBodyPatchSettings() { - return repeatDataBodyPatchSettings; - } - - /** Returns the object with the settings used for calls to getEnum. */ - public UnaryCallSettings getEnumSettings() { - return getEnumSettings; - } - - /** Returns the object with the settings used for calls to verifyEnum. */ - public UnaryCallSettings verifyEnumSettings() { - return verifyEnumSettings; - } - - public ComplianceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcComplianceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonComplianceStub.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 "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ComplianceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected ComplianceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - repeatDataBodySettings = settingsBuilder.repeatDataBodySettings().build(); - repeatDataBodyInfoSettings = settingsBuilder.repeatDataBodyInfoSettings().build(); - repeatDataQuerySettings = settingsBuilder.repeatDataQuerySettings().build(); - repeatDataSimplePathSettings = settingsBuilder.repeatDataSimplePathSettings().build(); - repeatDataPathResourceSettings = settingsBuilder.repeatDataPathResourceSettings().build(); - repeatDataPathTrailingResourceSettings = - settingsBuilder.repeatDataPathTrailingResourceSettings().build(); - repeatDataBodyPutSettings = settingsBuilder.repeatDataBodyPutSettings().build(); - repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); - getEnumSettings = settingsBuilder.getEnumSettings().build(); - verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); - } - - /** Builder for ComplianceStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder repeatDataBodySettings; - private final UnaryCallSettings.Builder - repeatDataBodyInfoSettings; - private final UnaryCallSettings.Builder repeatDataQuerySettings; - private final UnaryCallSettings.Builder - repeatDataSimplePathSettings; - private final UnaryCallSettings.Builder - repeatDataPathResourceSettings; - private final UnaryCallSettings.Builder - repeatDataPathTrailingResourceSettings; - private final UnaryCallSettings.Builder - repeatDataBodyPutSettings; - private final UnaryCallSettings.Builder - repeatDataBodyPatchSettings; - private final UnaryCallSettings.Builder getEnumSettings; - private final UnaryCallSettings.Builder verifyEnumSettings; - 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); - - repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataBodyInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataSimplePathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataPathResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataPathTrailingResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataBodyPutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - repeatDataBodySettings, - repeatDataBodyInfoSettings, - repeatDataQuerySettings, - repeatDataSimplePathSettings, - repeatDataPathResourceSettings, - repeatDataPathTrailingResourceSettings, - repeatDataBodyPutSettings, - repeatDataBodyPatchSettings, - getEnumSettings, - verifyEnumSettings); - initDefaults(this); - } - - protected Builder(ComplianceStubSettings settings) { - super(settings); - - repeatDataBodySettings = settings.repeatDataBodySettings.toBuilder(); - repeatDataBodyInfoSettings = settings.repeatDataBodyInfoSettings.toBuilder(); - repeatDataQuerySettings = settings.repeatDataQuerySettings.toBuilder(); - repeatDataSimplePathSettings = settings.repeatDataSimplePathSettings.toBuilder(); - repeatDataPathResourceSettings = settings.repeatDataPathResourceSettings.toBuilder(); - repeatDataPathTrailingResourceSettings = - settings.repeatDataPathTrailingResourceSettings.toBuilder(); - repeatDataBodyPutSettings = settings.repeatDataBodyPutSettings.toBuilder(); - repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); - getEnumSettings = settings.getEnumSettings.toBuilder(); - verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - repeatDataBodySettings, - repeatDataBodyInfoSettings, - repeatDataQuerySettings, - repeatDataSimplePathSettings, - repeatDataPathResourceSettings, - repeatDataPathTrailingResourceSettings, - repeatDataBodyPutSettings, - repeatDataBodyPatchSettings, - getEnumSettings, - verifyEnumSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .repeatDataBodySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataBodyInfoSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataSimplePathSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataPathResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataPathTrailingResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataBodyPutSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataBodyPatchSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getEnumSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .verifyEnumSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - 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 repeatDataBody. */ - public UnaryCallSettings.Builder repeatDataBodySettings() { - return repeatDataBodySettings; - } - - /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { - return repeatDataBodyInfoSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings.Builder repeatDataQuerySettings() { - return repeatDataQuerySettings; - } - - /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings.Builder repeatDataSimplePathSettings() { - return repeatDataSimplePathSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings.Builder - repeatDataPathResourceSettings() { - return repeatDataPathResourceSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings.Builder - repeatDataPathTrailingResourceSettings() { - return repeatDataPathTrailingResourceSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings.Builder repeatDataBodyPutSettings() { - return repeatDataBodyPutSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { - return repeatDataBodyPatchSettings; - } - - /** Returns the builder for the settings used for calls to getEnum. */ - public UnaryCallSettings.Builder getEnumSettings() { - return getEnumSettings; - } - - /** Returns the builder for the settings used for calls to verifyEnum. */ - public UnaryCallSettings.Builder verifyEnumSettings() { - return verifyEnumSettings; - } - - @Override - public ComplianceStubSettings build() throws IOException { - return new ComplianceStubSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStub.java deleted file mode 100644 index be6b33ec95..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStub.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Echo service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class EchoStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - return null; - } - - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { - return null; - } - - public UnaryCallable echoCallable() { - throw new UnsupportedOperationException("Not implemented: echoCallable()"); - } - - public ServerStreamingCallable expandCallable() { - throw new UnsupportedOperationException("Not implemented: expandCallable()"); - } - - public ClientStreamingCallable collectCallable() { - throw new UnsupportedOperationException("Not implemented: collectCallable()"); - } - - public BidiStreamingCallable chatCallable() { - throw new UnsupportedOperationException("Not implemented: chatCallable()"); - } - - public UnaryCallable pagedExpandPagedCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandPagedCallable()"); - } - - public UnaryCallable pagedExpandCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandCallable()"); - } - - public UnaryCallable pagedExpandLegacyCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); - } - - public UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - throw new UnsupportedOperationException( - "Not implemented: pagedExpandLegacyMappedPagedCallable()"); - } - - public UnaryCallable - pagedExpandLegacyMappedCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyMappedCallable()"); - } - - public OperationCallable waitOperationCallable() { - throw new UnsupportedOperationException("Not implemented: waitOperationCallable()"); - } - - public UnaryCallable waitCallable() { - throw new UnsupportedOperationException("Not implemented: waitCallable()"); - } - - public UnaryCallable blockCallable() { - throw new UnsupportedOperationException("Not implemented: blockCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStubSettings.java deleted file mode 100644 index d4d038ddd4..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ /dev/null @@ -1,713 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.PagedExpandResponseList; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link EchoStub}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 echo to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
- * echoSettingsBuilder
- *     .echoSettings()
- *     .setRetrySettings(
- *         echoSettingsBuilder
- *             .echoSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * EchoStubSettings echoSettings = echoSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings echoSettings; - private final ServerStreamingCallSettings expandSettings; - private final StreamingCallSettings collectSettings; - private final StreamingCallSettings chatSettings; - private final PagedCallSettings - pagedExpandSettings; - private final UnaryCallSettings - pagedExpandLegacySettings; - private final PagedCallSettings< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings; - private final UnaryCallSettings waitSettings; - private final OperationCallSettings - waitOperationSettings; - private final UnaryCallSettings blockSettings; - - private static final PagedListDescriptor - PAGED_EXPAND_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { - return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { - return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(PagedExpandRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(PagedExpandResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(PagedExpandResponse payload) { - return payload.getResponsesList() == null - ? ImmutableList.of() - : payload.getResponsesList(); - } - }; - - private static final PagedListDescriptor< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC = - new PagedListDescriptor< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { - return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { - return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(PagedExpandRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(PagedExpandLegacyMappedResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable> extractResources( - PagedExpandLegacyMappedResponse payload) { - return payload.getAlphabetizedMap() == null - ? Collections.>emptySet() - : payload.getAlphabetizedMap().entrySet(); - } - }; - - private static final PagedListResponseFactory< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - PAGED_EXPAND_PAGE_STR_FACT = - new PagedListResponseFactory< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - PagedExpandRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); - return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT = - new PagedListResponseFactory< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - PagedExpandRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - pageContext = - PageContext.create( - callable, PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC, request, context); - return PagedExpandLegacyMappedPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to echo. */ - public UnaryCallSettings echoSettings() { - return echoSettings; - } - - /** Returns the object with the settings used for calls to expand. */ - public ServerStreamingCallSettings expandSettings() { - return expandSettings; - } - - /** Returns the object with the settings used for calls to collect. */ - public StreamingCallSettings collectSettings() { - return collectSettings; - } - - /** Returns the object with the settings used for calls to chat. */ - public StreamingCallSettings chatSettings() { - return chatSettings; - } - - /** Returns the object with the settings used for calls to pagedExpand. */ - public PagedCallSettings - pagedExpandSettings() { - return pagedExpandSettings; - } - - /** Returns the object with the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings - pagedExpandLegacySettings() { - return pagedExpandLegacySettings; - } - - /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return pagedExpandLegacyMappedSettings; - } - - /** Returns the object with the settings used for calls to wait. */ - public UnaryCallSettings waitSettings() { - return waitSettings; - } - - /** Returns the object with the settings used for calls to wait. */ - public OperationCallSettings waitOperationSettings() { - return waitOperationSettings; - } - - /** Returns the object with the settings used for calls to block. */ - public UnaryCallSettings blockSettings() { - return blockSettings; - } - - public EchoStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcEchoStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonEchoStub.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 "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return EchoStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected EchoStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - echoSettings = settingsBuilder.echoSettings().build(); - expandSettings = settingsBuilder.expandSettings().build(); - collectSettings = settingsBuilder.collectSettings().build(); - chatSettings = settingsBuilder.chatSettings().build(); - pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); - pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); - pagedExpandLegacyMappedSettings = settingsBuilder.pagedExpandLegacyMappedSettings().build(); - waitSettings = settingsBuilder.waitSettings().build(); - waitOperationSettings = settingsBuilder.waitOperationSettings().build(); - blockSettings = settingsBuilder.blockSettings().build(); - } - - /** Builder for EchoStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder echoSettings; - private final ServerStreamingCallSettings.Builder expandSettings; - private final StreamingCallSettings.Builder collectSettings; - private final StreamingCallSettings.Builder chatSettings; - private final PagedCallSettings.Builder< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - pagedExpandSettings; - private final UnaryCallSettings.Builder - pagedExpandLegacySettings; - private final PagedCallSettings.Builder< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings; - private final UnaryCallSettings.Builder waitSettings; - private final OperationCallSettings.Builder - waitOperationSettings; - private final UnaryCallSettings.Builder blockSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - definitions.put( - "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("no_retry_0_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - expandSettings = ServerStreamingCallSettings.newBuilder(); - collectSettings = StreamingCallSettings.newBuilder(); - chatSettings = StreamingCallSettings.newBuilder(); - pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); - pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - pagedExpandLegacyMappedSettings = - PagedCallSettings.newBuilder(PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT); - waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - waitOperationSettings = OperationCallSettings.newBuilder(); - blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - echoSettings, - pagedExpandSettings, - pagedExpandLegacySettings, - pagedExpandLegacyMappedSettings, - waitSettings, - blockSettings); - initDefaults(this); - } - - protected Builder(EchoStubSettings settings) { - super(settings); - - echoSettings = settings.echoSettings.toBuilder(); - expandSettings = settings.expandSettings.toBuilder(); - collectSettings = settings.collectSettings.toBuilder(); - chatSettings = settings.chatSettings.toBuilder(); - pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); - pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); - pagedExpandLegacyMappedSettings = settings.pagedExpandLegacyMappedSettings.toBuilder(); - waitSettings = settings.waitSettings.toBuilder(); - waitOperationSettings = settings.waitOperationSettings.toBuilder(); - blockSettings = settings.blockSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - echoSettings, - pagedExpandSettings, - pagedExpandLegacySettings, - pagedExpandLegacyMappedSettings, - waitSettings, - blockSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .echoSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .expandSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .pagedExpandSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .pagedExpandLegacySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .pagedExpandLegacyMappedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .waitSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .blockSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .waitOperationSettings() - .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.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 echo. */ - public UnaryCallSettings.Builder echoSettings() { - return echoSettings; - } - - /** Returns the builder for the settings used for calls to expand. */ - public ServerStreamingCallSettings.Builder expandSettings() { - return expandSettings; - } - - /** Returns the builder for the settings used for calls to collect. */ - public StreamingCallSettings.Builder collectSettings() { - return collectSettings; - } - - /** Returns the builder for the settings used for calls to chat. */ - public StreamingCallSettings.Builder chatSettings() { - return chatSettings; - } - - /** Returns the builder for the settings used for calls to pagedExpand. */ - public PagedCallSettings.Builder< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - pagedExpandSettings() { - return pagedExpandSettings; - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings.Builder - pagedExpandLegacySettings() { - return pagedExpandLegacySettings; - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings.Builder< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return pagedExpandLegacyMappedSettings; - } - - /** Returns the builder for the settings used for calls to wait. */ - public UnaryCallSettings.Builder waitSettings() { - return waitSettings; - } - - /** Returns the builder for the settings used for calls to wait. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - waitOperationSettings() { - return waitOperationSettings; - } - - /** Returns the builder for the settings used for calls to block. */ - public UnaryCallSettings.Builder blockSettings() { - return blockSettings; - } - - @Override - public EchoStubSettings build() throws IOException { - return new EchoStubSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java deleted file mode 100644 index 953ca5555b..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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 Compliance service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcComplianceCallableFactory 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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java deleted file mode 100644 index 116d0fa5cb..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Compliance service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcComplianceStub extends ComplianceStub { - private static final MethodDescriptor - repeatDataBodyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataBodyInfoMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataQueryMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataSimplePathMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataPathResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataPathTrailingResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataBodyPutMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataBodyPatchMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getEnumMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") - .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor verifyEnumMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") - .setRequestMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable repeatDataBodyCallable; - private final UnaryCallable repeatDataBodyInfoCallable; - private final UnaryCallable repeatDataQueryCallable; - private final UnaryCallable repeatDataSimplePathCallable; - private final UnaryCallable repeatDataPathResourceCallable; - private final UnaryCallable repeatDataPathTrailingResourceCallable; - private final UnaryCallable repeatDataBodyPutCallable; - private final UnaryCallable repeatDataBodyPatchCallable; - private final UnaryCallable getEnumCallable; - private final UnaryCallable verifyEnumCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcComplianceStub create(ComplianceStubSettings settings) - throws IOException { - return new GrpcComplianceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcComplianceStub create(ClientContext clientContext) throws IOException { - return new GrpcComplianceStub(ComplianceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcComplianceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcComplianceStub( - ComplianceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcComplianceCallableFactory()); - } - - /** - * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub( - ComplianceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings repeatDataBodyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyMethodDescriptor) - .build(); - GrpcCallSettings repeatDataBodyInfoTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) - .build(); - GrpcCallSettings repeatDataQueryTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataQueryMethodDescriptor) - .build(); - GrpcCallSettings repeatDataSimplePathTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("info.f_bool", String.valueOf(request.getInfo().getFBool())); - params.put("info.f_double", String.valueOf(request.getInfo().getFDouble())); - params.put("info.f_int32", String.valueOf(request.getInfo().getFInt32())); - params.put("info.f_kingdom", String.valueOf(request.getInfo().getFKingdom())); - params.put("info.f_string", String.valueOf(request.getInfo().getFString())); - return params.build(); - }) - .build(); - GrpcCallSettings repeatDataPathResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("info.f_bool", String.valueOf(request.getInfo().getFBool())); - params.put( - "info.f_child.f_string", - String.valueOf(request.getInfo().getFChild().getFString())); - params.put("info.f_string", String.valueOf(request.getInfo().getFString())); - return params.build(); - }) - .build(); - GrpcCallSettings - repeatDataPathTrailingResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "info.f_child.f_string", - String.valueOf(request.getInfo().getFChild().getFString())); - params.put("info.f_string", String.valueOf(request.getInfo().getFString())); - return params.build(); - }) - .build(); - GrpcCallSettings repeatDataBodyPutTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) - .build(); - GrpcCallSettings repeatDataBodyPatchTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) - .build(); - GrpcCallSettings getEnumTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getEnumMethodDescriptor) - .build(); - GrpcCallSettings verifyEnumTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(verifyEnumMethodDescriptor) - .build(); - - this.repeatDataBodyCallable = - callableFactory.createUnaryCallable( - repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); - this.repeatDataBodyInfoCallable = - callableFactory.createUnaryCallable( - repeatDataBodyInfoTransportSettings, - settings.repeatDataBodyInfoSettings(), - clientContext); - this.repeatDataQueryCallable = - callableFactory.createUnaryCallable( - repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); - this.repeatDataSimplePathCallable = - callableFactory.createUnaryCallable( - repeatDataSimplePathTransportSettings, - settings.repeatDataSimplePathSettings(), - clientContext); - this.repeatDataPathResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathResourceTransportSettings, - settings.repeatDataPathResourceSettings(), - clientContext); - this.repeatDataPathTrailingResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathTrailingResourceTransportSettings, - settings.repeatDataPathTrailingResourceSettings(), - clientContext); - this.repeatDataBodyPutCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPutTransportSettings, - settings.repeatDataBodyPutSettings(), - clientContext); - this.repeatDataBodyPatchCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPatchTransportSettings, - settings.repeatDataBodyPatchSettings(), - clientContext); - this.getEnumCallable = - callableFactory.createUnaryCallable( - getEnumTransportSettings, settings.getEnumSettings(), clientContext); - this.verifyEnumCallable = - callableFactory.createUnaryCallable( - verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable repeatDataBodyCallable() { - return repeatDataBodyCallable; - } - - @Override - public UnaryCallable repeatDataBodyInfoCallable() { - return repeatDataBodyInfoCallable; - } - - @Override - public UnaryCallable repeatDataQueryCallable() { - return repeatDataQueryCallable; - } - - @Override - public UnaryCallable repeatDataSimplePathCallable() { - return repeatDataSimplePathCallable; - } - - @Override - public UnaryCallable repeatDataPathResourceCallable() { - return repeatDataPathResourceCallable; - } - - @Override - public UnaryCallable repeatDataPathTrailingResourceCallable() { - return repeatDataPathTrailingResourceCallable; - } - - @Override - public UnaryCallable repeatDataBodyPutCallable() { - return repeatDataBodyPutCallable; - } - - @Override - public UnaryCallable repeatDataBodyPatchCallable() { - return repeatDataBodyPatchCallable; - } - - @Override - public UnaryCallable getEnumCallable() { - return getEnumCallable; - } - - @Override - public UnaryCallable verifyEnumCallable() { - return verifyEnumCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java deleted file mode 100644 index 3306812933..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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 Echo service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcEchoCallableFactory 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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoStub.java deleted file mode 100644 index 3e8a99d5b2..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcEchoStub.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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.OperationCallable; -import com.google.api.gax.rpc.RequestParamsBuilder; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Echo service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcEchoStub extends EchoStub { - private static final MethodDescriptor echoMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/Echo") - .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor expandMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Echo/Expand") - .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor collectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Echo/Collect") - .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor chatMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Echo/Chat") - .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - pagedExpandMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") - .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - pagedExpandLegacyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") - .setRequestMarshaller( - ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - pagedExpandLegacyMappedMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") - .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(PagedExpandLegacyMappedResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor waitMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/Wait") - .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor blockMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/Block") - .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable echoCallable; - private final ServerStreamingCallable expandCallable; - private final ClientStreamingCallable collectCallable; - private final BidiStreamingCallable chatCallable; - private final UnaryCallable pagedExpandCallable; - private final UnaryCallable - pagedExpandPagedCallable; - private final UnaryCallable - pagedExpandLegacyCallable; - private final UnaryCallable - pagedExpandLegacyMappedCallable; - private final UnaryCallable - pagedExpandLegacyMappedPagedCallable; - private final UnaryCallable waitCallable; - private final OperationCallable waitOperationCallable; - private final UnaryCallable blockCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); - private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); - private static final PathTemplate ECHO_2_PATH_TEMPLATE = - PathTemplate.create("{table_name=regions/*/zones/*/**}"); - private static final PathTemplate ECHO_3_PATH_TEMPLATE = - PathTemplate.create("{super_id=projects/*}/**"); - private static final PathTemplate ECHO_4_PATH_TEMPLATE = - PathTemplate.create("{table_name=projects/*/instances/*/**}"); - private static final PathTemplate ECHO_5_PATH_TEMPLATE = - PathTemplate.create("projects/*/{instance_id=instances/*}/**"); - private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); - private static final PathTemplate ECHO_7_PATH_TEMPLATE = - PathTemplate.create("{qux=projects/*}/**"); - - public static final GrpcEchoStub create(EchoStubSettings settings) throws IOException { - return new GrpcEchoStub(settings, ClientContext.create(settings)); - } - - public static final GrpcEchoStub create(ClientContext clientContext) throws IOException { - return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcEchoStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub(EchoStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcEchoCallableFactory()); - } - - /** - * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub( - EchoStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings echoTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(echoMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); - builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); - builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); - builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); - builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); - builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); - builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); - builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); - return builder.build(); - }) - .build(); - GrpcCallSettings expandTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(expandMethodDescriptor) - .build(); - GrpcCallSettings collectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(collectMethodDescriptor) - .build(); - GrpcCallSettings chatTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(chatMethodDescriptor) - .build(); - GrpcCallSettings pagedExpandTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandMethodDescriptor) - .build(); - GrpcCallSettings - pagedExpandLegacyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) - .build(); - GrpcCallSettings - pagedExpandLegacyMappedTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) - .build(); - GrpcCallSettings waitTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(waitMethodDescriptor) - .build(); - GrpcCallSettings blockTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(blockMethodDescriptor) - .build(); - - this.echoCallable = - callableFactory.createUnaryCallable( - echoTransportSettings, settings.echoSettings(), clientContext); - this.expandCallable = - callableFactory.createServerStreamingCallable( - expandTransportSettings, settings.expandSettings(), clientContext); - this.collectCallable = - callableFactory.createClientStreamingCallable( - collectTransportSettings, settings.collectSettings(), clientContext); - this.chatCallable = - callableFactory.createBidiStreamingCallable( - chatTransportSettings, settings.chatSettings(), clientContext); - this.pagedExpandCallable = - callableFactory.createUnaryCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandPagedCallable = - callableFactory.createPagedCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandLegacyCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyTransportSettings, - settings.pagedExpandLegacySettings(), - clientContext); - this.pagedExpandLegacyMappedCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.pagedExpandLegacyMappedPagedCallable = - callableFactory.createPagedCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.waitCallable = - callableFactory.createUnaryCallable( - waitTransportSettings, settings.waitSettings(), clientContext); - this.waitOperationCallable = - callableFactory.createOperationCallable( - waitTransportSettings, settings.waitOperationSettings(), clientContext, operationsStub); - this.blockCallable = - callableFactory.createUnaryCallable( - blockTransportSettings, settings.blockSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable echoCallable() { - return echoCallable; - } - - @Override - public ServerStreamingCallable expandCallable() { - return expandCallable; - } - - @Override - public ClientStreamingCallable collectCallable() { - return collectCallable; - } - - @Override - public BidiStreamingCallable chatCallable() { - return chatCallable; - } - - @Override - public UnaryCallable pagedExpandCallable() { - return pagedExpandCallable; - } - - @Override - public UnaryCallable pagedExpandPagedCallable() { - return pagedExpandPagedCallable; - } - - @Override - public UnaryCallable pagedExpandLegacyCallable() { - return pagedExpandLegacyCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedCallable() { - return pagedExpandLegacyMappedCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - return pagedExpandLegacyMappedPagedCallable; - } - - @Override - public UnaryCallable waitCallable() { - return waitCallable; - } - - @Override - public OperationCallable waitOperationCallable() { - return waitOperationCallable; - } - - @Override - public UnaryCallable blockCallable() { - return blockCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java deleted file mode 100644 index 313391c0ee..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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 Identity service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcIdentityCallableFactory 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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java deleted file mode 100644 index 516fe97b2b..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Identity service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcIdentityStub extends IdentityStub { - private static final MethodDescriptor createUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") - .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") - .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listUsersMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") - .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createUserCallable; - private final UnaryCallable getUserCallable; - private final UnaryCallable updateUserCallable; - private final UnaryCallable deleteUserCallable; - private final UnaryCallable listUsersCallable; - private final UnaryCallable listUsersPagedCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcIdentityStub create(IdentityStubSettings settings) throws IOException { - return new GrpcIdentityStub(settings, ClientContext.create(settings)); - } - - public static final GrpcIdentityStub create(ClientContext clientContext) throws IOException { - return new GrpcIdentityStub(IdentityStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcIdentityStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcIdentityStub( - IdentityStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub(IdentityStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcIdentityCallableFactory()); - } - - /** - * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub( - IdentityStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createUserMethodDescriptor) - .build(); - GrpcCallSettings getUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getUserMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateUserMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("user.name", String.valueOf(request.getUser().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteUserMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listUsersTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listUsersMethodDescriptor) - .build(); - - this.createUserCallable = - callableFactory.createUnaryCallable( - createUserTransportSettings, settings.createUserSettings(), clientContext); - this.getUserCallable = - callableFactory.createUnaryCallable( - getUserTransportSettings, settings.getUserSettings(), clientContext); - this.updateUserCallable = - callableFactory.createUnaryCallable( - updateUserTransportSettings, settings.updateUserSettings(), clientContext); - this.deleteUserCallable = - callableFactory.createUnaryCallable( - deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); - this.listUsersCallable = - callableFactory.createUnaryCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - this.listUsersPagedCallable = - callableFactory.createPagedCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createUserCallable() { - return createUserCallable; - } - - @Override - public UnaryCallable getUserCallable() { - return getUserCallable; - } - - @Override - public UnaryCallable updateUserCallable() { - return updateUserCallable; - } - - @Override - public UnaryCallable deleteUserCallable() { - return deleteUserCallable; - } - - @Override - public UnaryCallable listUsersCallable() { - return listUsersCallable; - } - - @Override - public UnaryCallable listUsersPagedCallable() { - return listUsersPagedCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java deleted file mode 100644 index 82e36cdcdf..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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 Messaging service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcMessagingCallableFactory 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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java deleted file mode 100644 index 91be592df1..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.SendBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Messaging service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcMessagingStub extends MessagingStub { - private static final MethodDescriptor createRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") - .setRequestMarshaller(ProtoUtils.marshaller(CreateRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") - .setRequestMarshaller(ProtoUtils.marshaller(GetRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listRoomsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") - .setRequestMarshaller(ProtoUtils.marshaller(ListRoomsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListRoomsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor createBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(GetBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(ListBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListBlurbsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - searchBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(SearchBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - streamBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(StreamBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - sendBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Messaging/SendBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(SendBlurbsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - connectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Messaging/Connect") - .setRequestMarshaller(ProtoUtils.marshaller(ConnectRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createRoomCallable; - private final UnaryCallable getRoomCallable; - private final UnaryCallable updateRoomCallable; - private final UnaryCallable deleteRoomCallable; - private final UnaryCallable listRoomsCallable; - private final UnaryCallable listRoomsPagedCallable; - private final UnaryCallable createBlurbCallable; - private final UnaryCallable getBlurbCallable; - private final UnaryCallable updateBlurbCallable; - private final UnaryCallable deleteBlurbCallable; - private final UnaryCallable listBlurbsCallable; - private final UnaryCallable listBlurbsPagedCallable; - private final UnaryCallable searchBlurbsCallable; - private final OperationCallable - searchBlurbsOperationCallable; - private final ServerStreamingCallable - streamBlurbsCallable; - private final ClientStreamingCallable sendBlurbsCallable; - private final BidiStreamingCallable connectCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcMessagingStub create(MessagingStubSettings settings) throws IOException { - return new GrpcMessagingStub(settings, ClientContext.create(settings)); - } - - public static final GrpcMessagingStub create(ClientContext clientContext) throws IOException { - return new GrpcMessagingStub(MessagingStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcMessagingStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcMessagingStub( - MessagingStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub(MessagingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcMessagingCallableFactory()); - } - - /** - * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub( - MessagingStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createRoomMethodDescriptor) - .build(); - GrpcCallSettings getRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getRoomMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateRoomMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("room.name", String.valueOf(request.getRoom().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteRoomMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listRoomsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listRoomsMethodDescriptor) - .build(); - GrpcCallSettings createBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("blurb.name", String.valueOf(request.getBlurb().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings searchBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(searchBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings streamBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings sendBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(sendBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings connectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(connectMethodDescriptor) - .build(); - - this.createRoomCallable = - callableFactory.createUnaryCallable( - createRoomTransportSettings, settings.createRoomSettings(), clientContext); - this.getRoomCallable = - callableFactory.createUnaryCallable( - getRoomTransportSettings, settings.getRoomSettings(), clientContext); - this.updateRoomCallable = - callableFactory.createUnaryCallable( - updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); - this.deleteRoomCallable = - callableFactory.createUnaryCallable( - deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); - this.listRoomsCallable = - callableFactory.createUnaryCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.listRoomsPagedCallable = - callableFactory.createPagedCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.createBlurbCallable = - callableFactory.createUnaryCallable( - createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); - this.getBlurbCallable = - callableFactory.createUnaryCallable( - getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); - this.updateBlurbCallable = - callableFactory.createUnaryCallable( - updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); - this.deleteBlurbCallable = - callableFactory.createUnaryCallable( - deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); - this.listBlurbsCallable = - callableFactory.createUnaryCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.listBlurbsPagedCallable = - callableFactory.createPagedCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.searchBlurbsCallable = - callableFactory.createUnaryCallable( - searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); - this.searchBlurbsOperationCallable = - callableFactory.createOperationCallable( - searchBlurbsTransportSettings, - settings.searchBlurbsOperationSettings(), - clientContext, - operationsStub); - this.streamBlurbsCallable = - callableFactory.createServerStreamingCallable( - streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); - this.sendBlurbsCallable = - callableFactory.createClientStreamingCallable( - sendBlurbsTransportSettings, settings.sendBlurbsSettings(), clientContext); - this.connectCallable = - callableFactory.createBidiStreamingCallable( - connectTransportSettings, settings.connectSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createRoomCallable() { - return createRoomCallable; - } - - @Override - public UnaryCallable getRoomCallable() { - return getRoomCallable; - } - - @Override - public UnaryCallable updateRoomCallable() { - return updateRoomCallable; - } - - @Override - public UnaryCallable deleteRoomCallable() { - return deleteRoomCallable; - } - - @Override - public UnaryCallable listRoomsCallable() { - return listRoomsCallable; - } - - @Override - public UnaryCallable listRoomsPagedCallable() { - return listRoomsPagedCallable; - } - - @Override - public UnaryCallable createBlurbCallable() { - return createBlurbCallable; - } - - @Override - public UnaryCallable getBlurbCallable() { - return getBlurbCallable; - } - - @Override - public UnaryCallable updateBlurbCallable() { - return updateBlurbCallable; - } - - @Override - public UnaryCallable deleteBlurbCallable() { - return deleteBlurbCallable; - } - - @Override - public UnaryCallable listBlurbsCallable() { - return listBlurbsCallable; - } - - @Override - public UnaryCallable listBlurbsPagedCallable() { - return listBlurbsPagedCallable; - } - - @Override - public UnaryCallable searchBlurbsCallable() { - return searchBlurbsCallable; - } - - @Override - public OperationCallable - searchBlurbsOperationCallable() { - return searchBlurbsOperationCallable; - } - - @Override - public ServerStreamingCallable streamBlurbsCallable() { - return streamBlurbsCallable; - } - - @Override - public ClientStreamingCallable sendBlurbsCallable() { - return sendBlurbsCallable; - } - - @Override - public BidiStreamingCallable connectCallable() { - return connectCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java deleted file mode 100644 index b7ed163bf7..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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 SequenceService service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcSequenceServiceCallableFactory 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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java deleted file mode 100644 index 9f34118467..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the SequenceService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcSequenceServiceStub extends SequenceServiceStub { - private static final MethodDescriptor - createSequenceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateSequenceRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Sequence.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getSequenceReportMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") - .setRequestMarshaller( - ProtoUtils.marshaller(GetSequenceReportRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(SequenceReport.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - attemptSequenceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") - .setRequestMarshaller( - ProtoUtils.marshaller(AttemptSequenceRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private final UnaryCallable createSequenceCallable; - private final UnaryCallable getSequenceReportCallable; - private final UnaryCallable attemptSequenceCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSequenceServiceStub create(SequenceServiceStubSettings settings) - throws IOException { - return new GrpcSequenceServiceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSequenceServiceStub create(ClientContext clientContext) - throws IOException { - return new GrpcSequenceServiceStub( - SequenceServiceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSequenceServiceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSequenceServiceStub( - SequenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( - SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcSequenceServiceCallableFactory()); - } - - /** - * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( - SequenceServiceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createSequenceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSequenceMethodDescriptor) - .build(); - GrpcCallSettings getSequenceReportTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSequenceReportMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings attemptSequenceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(attemptSequenceMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.createSequenceCallable = - callableFactory.createUnaryCallable( - createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); - this.getSequenceReportCallable = - callableFactory.createUnaryCallable( - getSequenceReportTransportSettings, - settings.getSequenceReportSettings(), - clientContext); - this.attemptSequenceCallable = - callableFactory.createUnaryCallable( - attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createSequenceCallable() { - return createSequenceCallable; - } - - @Override - public UnaryCallable getSequenceReportCallable() { - return getSequenceReportCallable; - } - - @Override - public UnaryCallable attemptSequenceCallable() { - return attemptSequenceCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java deleted file mode 100644 index d117701765..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -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 Testing service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcTestingCallableFactory 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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingStub.java deleted file mode 100644 index 0787a31179..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/GrpcTestingStub.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Testing service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcTestingStub extends TestingStub { - private static final MethodDescriptor - createSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") - .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listSessionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") - .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - reportSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") - .setRequestMarshaller( - ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listTestsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") - .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteTestMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - verifyTestMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") - .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createSessionCallable; - private final UnaryCallable getSessionCallable; - private final UnaryCallable listSessionsCallable; - private final UnaryCallable - listSessionsPagedCallable; - private final UnaryCallable deleteSessionCallable; - private final UnaryCallable reportSessionCallable; - private final UnaryCallable listTestsCallable; - private final UnaryCallable listTestsPagedCallable; - private final UnaryCallable deleteTestCallable; - private final UnaryCallable verifyTestCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcTestingStub create(TestingStubSettings settings) throws IOException { - return new GrpcTestingStub(settings, ClientContext.create(settings)); - } - - public static final GrpcTestingStub create(ClientContext clientContext) throws IOException { - return new GrpcTestingStub(TestingStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcTestingStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcTestingStub( - TestingStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub(TestingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcTestingCallableFactory()); - } - - /** - * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub( - TestingStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSessionMethodDescriptor) - .build(); - GrpcCallSettings getSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSessionMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listSessionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listSessionsMethodDescriptor) - .build(); - GrpcCallSettings deleteSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteSessionMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings reportSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(reportSessionMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listTestsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listTestsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteTestTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteTestMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings verifyTestTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(verifyTestMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.createSessionCallable = - callableFactory.createUnaryCallable( - createSessionTransportSettings, settings.createSessionSettings(), clientContext); - this.getSessionCallable = - callableFactory.createUnaryCallable( - getSessionTransportSettings, settings.getSessionSettings(), clientContext); - this.listSessionsCallable = - callableFactory.createUnaryCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.listSessionsPagedCallable = - callableFactory.createPagedCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.deleteSessionCallable = - callableFactory.createUnaryCallable( - deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); - this.reportSessionCallable = - callableFactory.createUnaryCallable( - reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); - this.listTestsCallable = - callableFactory.createUnaryCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.listTestsPagedCallable = - callableFactory.createPagedCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.deleteTestCallable = - callableFactory.createUnaryCallable( - deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); - this.verifyTestCallable = - callableFactory.createUnaryCallable( - verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createSessionCallable() { - return createSessionCallable; - } - - @Override - public UnaryCallable getSessionCallable() { - return getSessionCallable; - } - - @Override - public UnaryCallable listSessionsCallable() { - return listSessionsCallable; - } - - @Override - public UnaryCallable listSessionsPagedCallable() { - return listSessionsPagedCallable; - } - - @Override - public UnaryCallable deleteSessionCallable() { - return deleteSessionCallable; - } - - @Override - public UnaryCallable reportSessionCallable() { - return reportSessionCallable; - } - - @Override - public UnaryCallable listTestsCallable() { - return listTestsCallable; - } - - @Override - public UnaryCallable listTestsPagedCallable() { - return listTestsPagedCallable; - } - - @Override - public UnaryCallable deleteTestCallable() { - return deleteTestCallable; - } - - @Override - public UnaryCallable verifyTestCallable() { - return verifyTestCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java deleted file mode 100644 index ae83f1e131..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Compliance service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonComplianceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java deleted file mode 100644 index 5fd2556f89..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java +++ /dev/null @@ -1,772 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Compliance service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonComplianceStub extends ComplianceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - repeatDataBodyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:body", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataBodyInfoMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:bodyinfo", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("info", request.getInfo(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataQueryMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:query", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataSimplePathMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat/{info.fString}/{info.fInt32}/{info.fDouble}/{info.fBool}/{info.fKingdom}:simplepath", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "info.fBool", request.getInfo().getFBool()); - serializer.putPathParam( - fields, "info.fDouble", request.getInfo().getFDouble()); - serializer.putPathParam( - fields, "info.fInt32", request.getInfo().getFInt32()); - serializer.putPathParam( - fields, "info.fKingdom", request.getInfo().getFKingdomValue()); - serializer.putPathParam( - fields, "info.fString", request.getInfo().getFString()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataPathResourceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/*}/bool/{info.fBool}:pathresource", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "info.fBool", request.getInfo().getFBool()); - serializer.putPathParam( - fields, - "info.fChild.fString", - request.getInfo().getFChild().getFString()); - serializer.putPathParam( - fields, "info.fString", request.getInfo().getFString()); - return fields; - }) - .setAdditionalPaths( - "/v1beta1/repeat/{info.fChild.fString=first/*}/{info.fString=second/*}/bool/{info.fBool}:childfirstpathresource") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataPathTrailingResourceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName( - "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/**}:pathtrailingresource", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, - "info.fChild.fString", - request.getInfo().getFChild().getFString()); - serializer.putPathParam( - fields, "info.fString", request.getInfo().getFString()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataBodyPutMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") - .setHttpMethod("PUT") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:bodyput", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataBodyPatchMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:bodypatch", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getEnumMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/compliance/enum", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EnumResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor verifyEnumMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/compliance/enum", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "continent", request.getContinentValue()); - serializer.putQueryParam(fields, "request", request.getRequest()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EnumResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable repeatDataBodyCallable; - private final UnaryCallable repeatDataBodyInfoCallable; - private final UnaryCallable repeatDataQueryCallable; - private final UnaryCallable repeatDataSimplePathCallable; - private final UnaryCallable repeatDataPathResourceCallable; - private final UnaryCallable repeatDataPathTrailingResourceCallable; - private final UnaryCallable repeatDataBodyPutCallable; - private final UnaryCallable repeatDataBodyPatchCallable; - private final UnaryCallable getEnumCallable; - private final UnaryCallable verifyEnumCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonComplianceStub create(ComplianceStubSettings settings) - throws IOException { - return new HttpJsonComplianceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonComplianceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonComplianceStub( - ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonComplianceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonComplianceStub( - ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonComplianceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub( - ComplianceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings repeatDataBodyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataBodyInfoTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataQueryTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataQueryMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataSimplePathTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataPathResourceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - repeatDataPathTrailingResourceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataBodyPutTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataBodyPatchTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getEnumTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getEnumMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings verifyEnumTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(verifyEnumMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.repeatDataBodyCallable = - callableFactory.createUnaryCallable( - repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); - this.repeatDataBodyInfoCallable = - callableFactory.createUnaryCallable( - repeatDataBodyInfoTransportSettings, - settings.repeatDataBodyInfoSettings(), - clientContext); - this.repeatDataQueryCallable = - callableFactory.createUnaryCallable( - repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); - this.repeatDataSimplePathCallable = - callableFactory.createUnaryCallable( - repeatDataSimplePathTransportSettings, - settings.repeatDataSimplePathSettings(), - clientContext); - this.repeatDataPathResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathResourceTransportSettings, - settings.repeatDataPathResourceSettings(), - clientContext); - this.repeatDataPathTrailingResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathTrailingResourceTransportSettings, - settings.repeatDataPathTrailingResourceSettings(), - clientContext); - this.repeatDataBodyPutCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPutTransportSettings, - settings.repeatDataBodyPutSettings(), - clientContext); - this.repeatDataBodyPatchCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPatchTransportSettings, - settings.repeatDataBodyPatchSettings(), - clientContext); - this.getEnumCallable = - callableFactory.createUnaryCallable( - getEnumTransportSettings, settings.getEnumSettings(), clientContext); - this.verifyEnumCallable = - callableFactory.createUnaryCallable( - verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(repeatDataBodyMethodDescriptor); - methodDescriptors.add(repeatDataBodyInfoMethodDescriptor); - methodDescriptors.add(repeatDataQueryMethodDescriptor); - methodDescriptors.add(repeatDataSimplePathMethodDescriptor); - methodDescriptors.add(repeatDataPathResourceMethodDescriptor); - methodDescriptors.add(repeatDataPathTrailingResourceMethodDescriptor); - methodDescriptors.add(repeatDataBodyPutMethodDescriptor); - methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); - methodDescriptors.add(getEnumMethodDescriptor); - methodDescriptors.add(verifyEnumMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable repeatDataBodyCallable() { - return repeatDataBodyCallable; - } - - @Override - public UnaryCallable repeatDataBodyInfoCallable() { - return repeatDataBodyInfoCallable; - } - - @Override - public UnaryCallable repeatDataQueryCallable() { - return repeatDataQueryCallable; - } - - @Override - public UnaryCallable repeatDataSimplePathCallable() { - return repeatDataSimplePathCallable; - } - - @Override - public UnaryCallable repeatDataPathResourceCallable() { - return repeatDataPathResourceCallable; - } - - @Override - public UnaryCallable repeatDataPathTrailingResourceCallable() { - return repeatDataPathTrailingResourceCallable; - } - - @Override - public UnaryCallable repeatDataBodyPutCallable() { - return repeatDataBodyPutCallable; - } - - @Override - public UnaryCallable repeatDataBodyPatchCallable() { - return repeatDataBodyPatchCallable; - } - - @Override - public UnaryCallable getEnumCallable() { - return getEnumCallable; - } - - @Override - public UnaryCallable verifyEnumCallable() { - return verifyEnumCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java deleted file mode 100644 index 0702689af2..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Echo service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonEchoCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java deleted file mode 100644 index 3ddb5d3570..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Echo service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonEchoStub extends EchoStub { - private static final TypeRegistry typeRegistry = - TypeRegistry.newBuilder() - .add(WaitResponse.getDescriptor()) - .add(WaitMetadata.getDescriptor()) - .build(); - - private static final ApiMethodDescriptor echoMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Echo") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:echo", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EchoResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor expandMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Expand") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:expand", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EchoResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - pagedExpandMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:pagedExpand", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - pagedExpandLegacyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:pagedExpandLegacy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - pagedExpandLegacyMappedMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:pagedExpandLegacyMapped", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PagedExpandLegacyMappedResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor waitMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Wait") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:wait", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .setOperationSnapshotFactory( - (WaitRequest request, Operation response) -> - HttpJsonOperationSnapshot.create(response)) - .build(); - - private static final ApiMethodDescriptor blockMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Block") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:block", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(BlockResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable echoCallable; - private final ServerStreamingCallable expandCallable; - private final UnaryCallable pagedExpandCallable; - private final UnaryCallable - pagedExpandPagedCallable; - private final UnaryCallable - pagedExpandLegacyCallable; - private final UnaryCallable - pagedExpandLegacyMappedCallable; - private final UnaryCallable - pagedExpandLegacyMappedPagedCallable; - private final UnaryCallable waitCallable; - private final OperationCallable waitOperationCallable; - private final UnaryCallable blockCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonOperationsStub httpJsonOperationsStub; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { - return new HttpJsonEchoStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { - return new HttpJsonEchoStub(EchoStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonEchoStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonEchoStub( - EchoStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonEchoCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( - EchoStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); - - HttpJsonCallSettings echoTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(echoMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings expandTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(expandMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings pagedExpandTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - pagedExpandLegacyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - pagedExpandLegacyMappedTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings waitTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(waitMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings blockTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(blockMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.echoCallable = - callableFactory.createUnaryCallable( - echoTransportSettings, settings.echoSettings(), clientContext); - this.expandCallable = - callableFactory.createServerStreamingCallable( - expandTransportSettings, settings.expandSettings(), clientContext); - this.pagedExpandCallable = - callableFactory.createUnaryCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandPagedCallable = - callableFactory.createPagedCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandLegacyCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyTransportSettings, - settings.pagedExpandLegacySettings(), - clientContext); - this.pagedExpandLegacyMappedCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.pagedExpandLegacyMappedPagedCallable = - callableFactory.createPagedCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.waitCallable = - callableFactory.createUnaryCallable( - waitTransportSettings, settings.waitSettings(), clientContext); - this.waitOperationCallable = - callableFactory.createOperationCallable( - waitTransportSettings, - settings.waitOperationSettings(), - clientContext, - httpJsonOperationsStub); - this.blockCallable = - callableFactory.createUnaryCallable( - blockTransportSettings, settings.blockSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(echoMethodDescriptor); - methodDescriptors.add(expandMethodDescriptor); - methodDescriptors.add(pagedExpandMethodDescriptor); - methodDescriptors.add(pagedExpandLegacyMethodDescriptor); - methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); - methodDescriptors.add(waitMethodDescriptor); - methodDescriptors.add(blockMethodDescriptor); - return methodDescriptors; - } - - public HttpJsonOperationsStub getHttpJsonOperationsStub() { - return httpJsonOperationsStub; - } - - @Override - public UnaryCallable echoCallable() { - return echoCallable; - } - - @Override - public ServerStreamingCallable expandCallable() { - return expandCallable; - } - - @Override - public UnaryCallable pagedExpandCallable() { - return pagedExpandCallable; - } - - @Override - public UnaryCallable pagedExpandPagedCallable() { - return pagedExpandPagedCallable; - } - - @Override - public UnaryCallable pagedExpandLegacyCallable() { - return pagedExpandLegacyCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedCallable() { - return pagedExpandLegacyMappedCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - return pagedExpandLegacyMappedPagedCallable; - } - - @Override - public UnaryCallable waitCallable() { - return waitCallable; - } - - @Override - public OperationCallable waitOperationCallable() { - return waitOperationCallable; - } - - @Override - public UnaryCallable blockCallable() { - return blockCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java deleted file mode 100644 index b8766ddbcd..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Identity service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonIdentityCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java deleted file mode 100644 index 528858e711..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Identity service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonIdentityStub extends IdentityStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor createUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/users", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(User.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=users/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(User.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{user.name=users/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "user.name", request.getUser().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("user", request.getUser(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(User.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=users/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listUsersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/users", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListUsersResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createUserCallable; - private final UnaryCallable getUserCallable; - private final UnaryCallable updateUserCallable; - private final UnaryCallable deleteUserCallable; - private final UnaryCallable listUsersCallable; - private final UnaryCallable listUsersPagedCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonIdentityStub create(IdentityStubSettings settings) - throws IOException { - return new HttpJsonIdentityStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonIdentityStub create(ClientContext clientContext) throws IOException { - return new HttpJsonIdentityStub( - IdentityStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonIdentityStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonIdentityStub( - IdentityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub(IdentityStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonIdentityCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub( - IdentityStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listUsersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listUsersMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createUserCallable = - callableFactory.createUnaryCallable( - createUserTransportSettings, settings.createUserSettings(), clientContext); - this.getUserCallable = - callableFactory.createUnaryCallable( - getUserTransportSettings, settings.getUserSettings(), clientContext); - this.updateUserCallable = - callableFactory.createUnaryCallable( - updateUserTransportSettings, settings.updateUserSettings(), clientContext); - this.deleteUserCallable = - callableFactory.createUnaryCallable( - deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); - this.listUsersCallable = - callableFactory.createUnaryCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - this.listUsersPagedCallable = - callableFactory.createPagedCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createUserMethodDescriptor); - methodDescriptors.add(getUserMethodDescriptor); - methodDescriptors.add(updateUserMethodDescriptor); - methodDescriptors.add(deleteUserMethodDescriptor); - methodDescriptors.add(listUsersMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createUserCallable() { - return createUserCallable; - } - - @Override - public UnaryCallable getUserCallable() { - return getUserCallable; - } - - @Override - public UnaryCallable updateUserCallable() { - return updateUserCallable; - } - - @Override - public UnaryCallable deleteUserCallable() { - return deleteUserCallable; - } - - @Override - public UnaryCallable listUsersCallable() { - return listUsersCallable; - } - - @Override - public UnaryCallable listUsersPagedCallable() { - return listUsersPagedCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java deleted file mode 100644 index f56157bdd4..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Messaging service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonMessagingCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java deleted file mode 100644 index 41ac603817..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java +++ /dev/null @@ -1,823 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Messaging service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonMessagingStub extends MessagingStub { - private static final TypeRegistry typeRegistry = - TypeRegistry.newBuilder() - .add(SearchBlurbsResponse.getDescriptor()) - .add(SearchBlurbsMetadata.getDescriptor()) - .build(); - - private static final ApiMethodDescriptor createRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/rooms", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Room.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Room.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{room.name=rooms/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "room.name", request.getRoom().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("room", request.getRoom(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Room.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listRoomsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/rooms", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListRoomsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor createBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=rooms/*}/blurbs", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Blurb.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*/blurbs/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Blurb.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{blurb.name=rooms/*/blurbs/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "blurb.name", request.getBlurb().getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{blurb.name=users/*/profile/blurbs/*}") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Blurb.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*/blurbs/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listBlurbsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=rooms/*}/blurbs", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListBlurbsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - searchBlurbsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=rooms/*}/blurbs:search", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs:search") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .setOperationSnapshotFactory( - (SearchBlurbsRequest request, Operation response) -> - HttpJsonOperationSnapshot.create(response)) - .build(); - - private static final ApiMethodDescriptor - streamBlurbsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*}/blurbs:stream", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{name=users/*/profile}/blurbs:stream") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createRoomCallable; - private final UnaryCallable getRoomCallable; - private final UnaryCallable updateRoomCallable; - private final UnaryCallable deleteRoomCallable; - private final UnaryCallable listRoomsCallable; - private final UnaryCallable listRoomsPagedCallable; - private final UnaryCallable createBlurbCallable; - private final UnaryCallable getBlurbCallable; - private final UnaryCallable updateBlurbCallable; - private final UnaryCallable deleteBlurbCallable; - private final UnaryCallable listBlurbsCallable; - private final UnaryCallable listBlurbsPagedCallable; - private final UnaryCallable searchBlurbsCallable; - private final OperationCallable - searchBlurbsOperationCallable; - private final ServerStreamingCallable - streamBlurbsCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonOperationsStub httpJsonOperationsStub; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonMessagingStub create(MessagingStubSettings settings) - throws IOException { - return new HttpJsonMessagingStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonMessagingStub create(ClientContext clientContext) throws IOException { - return new HttpJsonMessagingStub( - MessagingStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonMessagingStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonMessagingStub( - MessagingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub(MessagingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonMessagingCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub( - MessagingStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); - - HttpJsonCallSettings createRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listRoomsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRoomsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings createBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listBlurbsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listBlurbsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings searchBlurbsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(searchBlurbsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings streamBlurbsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(streamBlurbsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createRoomCallable = - callableFactory.createUnaryCallable( - createRoomTransportSettings, settings.createRoomSettings(), clientContext); - this.getRoomCallable = - callableFactory.createUnaryCallable( - getRoomTransportSettings, settings.getRoomSettings(), clientContext); - this.updateRoomCallable = - callableFactory.createUnaryCallable( - updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); - this.deleteRoomCallable = - callableFactory.createUnaryCallable( - deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); - this.listRoomsCallable = - callableFactory.createUnaryCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.listRoomsPagedCallable = - callableFactory.createPagedCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.createBlurbCallable = - callableFactory.createUnaryCallable( - createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); - this.getBlurbCallable = - callableFactory.createUnaryCallable( - getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); - this.updateBlurbCallable = - callableFactory.createUnaryCallable( - updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); - this.deleteBlurbCallable = - callableFactory.createUnaryCallable( - deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); - this.listBlurbsCallable = - callableFactory.createUnaryCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.listBlurbsPagedCallable = - callableFactory.createPagedCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.searchBlurbsCallable = - callableFactory.createUnaryCallable( - searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); - this.searchBlurbsOperationCallable = - callableFactory.createOperationCallable( - searchBlurbsTransportSettings, - settings.searchBlurbsOperationSettings(), - clientContext, - httpJsonOperationsStub); - this.streamBlurbsCallable = - callableFactory.createServerStreamingCallable( - streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createRoomMethodDescriptor); - methodDescriptors.add(getRoomMethodDescriptor); - methodDescriptors.add(updateRoomMethodDescriptor); - methodDescriptors.add(deleteRoomMethodDescriptor); - methodDescriptors.add(listRoomsMethodDescriptor); - methodDescriptors.add(createBlurbMethodDescriptor); - methodDescriptors.add(getBlurbMethodDescriptor); - methodDescriptors.add(updateBlurbMethodDescriptor); - methodDescriptors.add(deleteBlurbMethodDescriptor); - methodDescriptors.add(listBlurbsMethodDescriptor); - methodDescriptors.add(searchBlurbsMethodDescriptor); - methodDescriptors.add(streamBlurbsMethodDescriptor); - return methodDescriptors; - } - - public HttpJsonOperationsStub getHttpJsonOperationsStub() { - return httpJsonOperationsStub; - } - - @Override - public UnaryCallable createRoomCallable() { - return createRoomCallable; - } - - @Override - public UnaryCallable getRoomCallable() { - return getRoomCallable; - } - - @Override - public UnaryCallable updateRoomCallable() { - return updateRoomCallable; - } - - @Override - public UnaryCallable deleteRoomCallable() { - return deleteRoomCallable; - } - - @Override - public UnaryCallable listRoomsCallable() { - return listRoomsCallable; - } - - @Override - public UnaryCallable listRoomsPagedCallable() { - return listRoomsPagedCallable; - } - - @Override - public UnaryCallable createBlurbCallable() { - return createBlurbCallable; - } - - @Override - public UnaryCallable getBlurbCallable() { - return getBlurbCallable; - } - - @Override - public UnaryCallable updateBlurbCallable() { - return updateBlurbCallable; - } - - @Override - public UnaryCallable deleteBlurbCallable() { - return deleteBlurbCallable; - } - - @Override - public UnaryCallable listBlurbsCallable() { - return listBlurbsCallable; - } - - @Override - public UnaryCallable listBlurbsPagedCallable() { - return listBlurbsPagedCallable; - } - - @Override - public UnaryCallable searchBlurbsCallable() { - return searchBlurbsCallable; - } - - @Override - public OperationCallable - searchBlurbsOperationCallable() { - return searchBlurbsOperationCallable; - } - - @Override - public ServerStreamingCallable streamBlurbsCallable() { - return streamBlurbsCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java deleted file mode 100644 index dc37c46e8a..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the SequenceService service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonSequenceServiceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java deleted file mode 100644 index c2522b9648..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the SequenceService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonSequenceServiceStub extends SequenceServiceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createSequenceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/sequences", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("sequence", request.getSequence(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Sequence.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getSequenceReportMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sequences/*/sequenceReport}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(SequenceReport.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - attemptSequenceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sequences/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createSequenceCallable; - private final UnaryCallable getSequenceReportCallable; - private final UnaryCallable attemptSequenceCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonSequenceServiceStub create(SequenceServiceStubSettings settings) - throws IOException { - return new HttpJsonSequenceServiceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonSequenceServiceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonSequenceServiceStub( - SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonSequenceServiceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSequenceServiceStub( - SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( - SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new HttpJsonSequenceServiceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( - SequenceServiceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createSequenceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSequenceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - getSequenceReportTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSequenceReportMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings attemptSequenceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(attemptSequenceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createSequenceCallable = - callableFactory.createUnaryCallable( - createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); - this.getSequenceReportCallable = - callableFactory.createUnaryCallable( - getSequenceReportTransportSettings, - settings.getSequenceReportSettings(), - clientContext); - this.attemptSequenceCallable = - callableFactory.createUnaryCallable( - attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createSequenceMethodDescriptor); - methodDescriptors.add(getSequenceReportMethodDescriptor); - methodDescriptors.add(attemptSequenceMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createSequenceCallable() { - return createSequenceCallable; - } - - @Override - public UnaryCallable getSequenceReportCallable() { - return getSequenceReportCallable; - } - - @Override - public UnaryCallable attemptSequenceCallable() { - return attemptSequenceCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java deleted file mode 100644 index c33422c6ae..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Testing service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonTestingCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java deleted file mode 100644 index eb1a664bb0..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Testing service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonTestingStub extends TestingStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/sessions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("session", request.getSession(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Session.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Session.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listSessionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/sessions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - reportSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*}:report", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ReportSessionResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listTestsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=sessions/*}/tests", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListTestsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteTestMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*/tests/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - verifyTestMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*/tests/*}:check", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "answer", request.getAnswer()); - serializer.putQueryParam(fields, "answers", request.getAnswersList()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createSessionCallable; - private final UnaryCallable getSessionCallable; - private final UnaryCallable listSessionsCallable; - private final UnaryCallable - listSessionsPagedCallable; - private final UnaryCallable deleteSessionCallable; - private final UnaryCallable reportSessionCallable; - private final UnaryCallable listTestsCallable; - private final UnaryCallable listTestsPagedCallable; - private final UnaryCallable deleteTestCallable; - private final UnaryCallable verifyTestCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonTestingStub create(TestingStubSettings settings) throws IOException { - return new HttpJsonTestingStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonTestingStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTestingStub(TestingStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonTestingStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTestingStub( - TestingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub(TestingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonTestingCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub( - TestingStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listSessionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSessionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - reportSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(reportSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listTestsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTestsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteTestTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTestMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings verifyTestTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(verifyTestMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createSessionCallable = - callableFactory.createUnaryCallable( - createSessionTransportSettings, settings.createSessionSettings(), clientContext); - this.getSessionCallable = - callableFactory.createUnaryCallable( - getSessionTransportSettings, settings.getSessionSettings(), clientContext); - this.listSessionsCallable = - callableFactory.createUnaryCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.listSessionsPagedCallable = - callableFactory.createPagedCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.deleteSessionCallable = - callableFactory.createUnaryCallable( - deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); - this.reportSessionCallable = - callableFactory.createUnaryCallable( - reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); - this.listTestsCallable = - callableFactory.createUnaryCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.listTestsPagedCallable = - callableFactory.createPagedCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.deleteTestCallable = - callableFactory.createUnaryCallable( - deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); - this.verifyTestCallable = - callableFactory.createUnaryCallable( - verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createSessionMethodDescriptor); - methodDescriptors.add(getSessionMethodDescriptor); - methodDescriptors.add(listSessionsMethodDescriptor); - methodDescriptors.add(deleteSessionMethodDescriptor); - methodDescriptors.add(reportSessionMethodDescriptor); - methodDescriptors.add(listTestsMethodDescriptor); - methodDescriptors.add(deleteTestMethodDescriptor); - methodDescriptors.add(verifyTestMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createSessionCallable() { - return createSessionCallable; - } - - @Override - public UnaryCallable getSessionCallable() { - return getSessionCallable; - } - - @Override - public UnaryCallable listSessionsCallable() { - return listSessionsCallable; - } - - @Override - public UnaryCallable listSessionsPagedCallable() { - return listSessionsPagedCallable; - } - - @Override - public UnaryCallable deleteSessionCallable() { - return deleteSessionCallable; - } - - @Override - public UnaryCallable reportSessionCallable() { - return reportSessionCallable; - } - - @Override - public UnaryCallable listTestsCallable() { - return listTestsCallable; - } - - @Override - public UnaryCallable listTestsPagedCallable() { - return listTestsPagedCallable; - } - - @Override - public UnaryCallable deleteTestCallable() { - return deleteTestCallable; - } - - @Override - public UnaryCallable verifyTestCallable() { - return verifyTestCallable; - } - - @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/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStub.java deleted file mode 100644 index b09d5c635e..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStub.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Identity service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class IdentityStub implements BackgroundResource { - - public UnaryCallable createUserCallable() { - throw new UnsupportedOperationException("Not implemented: createUserCallable()"); - } - - public UnaryCallable getUserCallable() { - throw new UnsupportedOperationException("Not implemented: getUserCallable()"); - } - - public UnaryCallable updateUserCallable() { - throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); - } - - public UnaryCallable deleteUserCallable() { - throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); - } - - public UnaryCallable listUsersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); - } - - public UnaryCallable listUsersCallable() { - throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStubSettings.java deleted file mode 100644 index 92aaa1133d..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/IdentityStubSettings.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -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 IdentityStub}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createUser to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder();
- * identitySettingsBuilder
- *     .createUserSettings()
- *     .setRetrySettings(
- *         identitySettingsBuilder
- *             .createUserSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * IdentityStubSettings identitySettings = identitySettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class IdentityStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createUserSettings; - private final UnaryCallSettings getUserSettings; - private final UnaryCallSettings updateUserSettings; - private final UnaryCallSettings deleteUserSettings; - private final PagedCallSettings - listUsersSettings; - - private static final PagedListDescriptor - LIST_USERS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListUsersRequest injectToken(ListUsersRequest payload, String token) { - return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { - return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListUsersRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListUsersResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListUsersResponse payload) { - return payload.getUsersList() == null - ? ImmutableList.of() - : payload.getUsersList(); - } - }; - - private static final PagedListResponseFactory< - ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> - LIST_USERS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListUsersRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); - return ListUsersPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createUser. */ - public UnaryCallSettings createUserSettings() { - return createUserSettings; - } - - /** Returns the object with the settings used for calls to getUser. */ - public UnaryCallSettings getUserSettings() { - return getUserSettings; - } - - /** Returns the object with the settings used for calls to updateUser. */ - public UnaryCallSettings updateUserSettings() { - return updateUserSettings; - } - - /** Returns the object with the settings used for calls to deleteUser. */ - public UnaryCallSettings deleteUserSettings() { - return deleteUserSettings; - } - - /** Returns the object with the settings used for calls to listUsers. */ - public PagedCallSettings - listUsersSettings() { - return listUsersSettings; - } - - public IdentityStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcIdentityStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonIdentityStub.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 "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return IdentityStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected IdentityStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createUserSettings = settingsBuilder.createUserSettings().build(); - getUserSettings = settingsBuilder.getUserSettings().build(); - updateUserSettings = settingsBuilder.updateUserSettings().build(); - deleteUserSettings = settingsBuilder.deleteUserSettings().build(); - listUsersSettings = settingsBuilder.listUsersSettings().build(); - } - - /** Builder for IdentityStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createUserSettings; - private final UnaryCallSettings.Builder getUserSettings; - private final UnaryCallSettings.Builder updateUserSettings; - private final UnaryCallSettings.Builder deleteUserSettings; - private final PagedCallSettings.Builder< - ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> - listUsersSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - 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); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(200L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createUserSettings, - getUserSettings, - updateUserSettings, - deleteUserSettings, - listUsersSettings); - initDefaults(this); - } - - protected Builder(IdentityStubSettings settings) { - super(settings); - - createUserSettings = settings.createUserSettings.toBuilder(); - getUserSettings = settings.getUserSettings.toBuilder(); - updateUserSettings = settings.updateUserSettings.toBuilder(); - deleteUserSettings = settings.deleteUserSettings.toBuilder(); - listUsersSettings = settings.listUsersSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createUserSettings, - getUserSettings, - updateUserSettings, - deleteUserSettings, - listUsersSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .updateUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listUsersSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - 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 createUser. */ - public UnaryCallSettings.Builder createUserSettings() { - return createUserSettings; - } - - /** Returns the builder for the settings used for calls to getUser. */ - public UnaryCallSettings.Builder getUserSettings() { - return getUserSettings; - } - - /** Returns the builder for the settings used for calls to updateUser. */ - public UnaryCallSettings.Builder updateUserSettings() { - return updateUserSettings; - } - - /** Returns the builder for the settings used for calls to deleteUser. */ - public UnaryCallSettings.Builder deleteUserSettings() { - return deleteUserSettings; - } - - /** Returns the builder for the settings used for calls to listUsers. */ - public PagedCallSettings.Builder - listUsersSettings() { - return listUsersSettings; - } - - @Override - public IdentityStubSettings build() throws IOException { - return new IdentityStubSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStub.java deleted file mode 100644 index 50372c599b..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStub.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.SendBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Messaging service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class MessagingStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - return null; - } - - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { - return null; - } - - public UnaryCallable createRoomCallable() { - throw new UnsupportedOperationException("Not implemented: createRoomCallable()"); - } - - public UnaryCallable getRoomCallable() { - throw new UnsupportedOperationException("Not implemented: getRoomCallable()"); - } - - public UnaryCallable updateRoomCallable() { - throw new UnsupportedOperationException("Not implemented: updateRoomCallable()"); - } - - public UnaryCallable deleteRoomCallable() { - throw new UnsupportedOperationException("Not implemented: deleteRoomCallable()"); - } - - public UnaryCallable listRoomsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRoomsPagedCallable()"); - } - - public UnaryCallable listRoomsCallable() { - throw new UnsupportedOperationException("Not implemented: listRoomsCallable()"); - } - - public UnaryCallable createBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: createBlurbCallable()"); - } - - public UnaryCallable getBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: getBlurbCallable()"); - } - - public UnaryCallable updateBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: updateBlurbCallable()"); - } - - public UnaryCallable deleteBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: deleteBlurbCallable()"); - } - - public UnaryCallable listBlurbsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listBlurbsPagedCallable()"); - } - - public UnaryCallable listBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: listBlurbsCallable()"); - } - - public OperationCallable - searchBlurbsOperationCallable() { - throw new UnsupportedOperationException("Not implemented: searchBlurbsOperationCallable()"); - } - - public UnaryCallable searchBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: searchBlurbsCallable()"); - } - - public ServerStreamingCallable streamBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: streamBlurbsCallable()"); - } - - public ClientStreamingCallable sendBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: sendBlurbsCallable()"); - } - - public BidiStreamingCallable connectCallable() { - throw new UnsupportedOperationException("Not implemented: connectCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStubSettings.java deleted file mode 100644 index 326883942f..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ /dev/null @@ -1,815 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.SendBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -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 MessagingStub}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createRoom to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
- * messagingSettingsBuilder
- *     .createRoomSettings()
- *     .setRetrySettings(
- *         messagingSettingsBuilder
- *             .createRoomSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class MessagingStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createRoomSettings; - private final UnaryCallSettings getRoomSettings; - private final UnaryCallSettings updateRoomSettings; - private final UnaryCallSettings deleteRoomSettings; - private final PagedCallSettings - listRoomsSettings; - private final UnaryCallSettings createBlurbSettings; - private final UnaryCallSettings getBlurbSettings; - private final UnaryCallSettings updateBlurbSettings; - private final UnaryCallSettings deleteBlurbSettings; - private final PagedCallSettings - listBlurbsSettings; - private final UnaryCallSettings searchBlurbsSettings; - private final OperationCallSettings< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings; - private final ServerStreamingCallSettings - streamBlurbsSettings; - private final StreamingCallSettings sendBlurbsSettings; - private final StreamingCallSettings connectSettings; - - private static final PagedListDescriptor - LIST_ROOMS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListRoomsRequest injectToken(ListRoomsRequest payload, String token) { - return ListRoomsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListRoomsRequest injectPageSize(ListRoomsRequest payload, int pageSize) { - return ListRoomsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListRoomsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListRoomsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListRoomsResponse payload) { - return payload.getRoomsList() == null - ? ImmutableList.of() - : payload.getRoomsList(); - } - }; - - private static final PagedListDescriptor - LIST_BLURBS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListBlurbsRequest injectToken(ListBlurbsRequest payload, String token) { - return ListBlurbsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListBlurbsRequest injectPageSize(ListBlurbsRequest payload, int pageSize) { - return ListBlurbsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListBlurbsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListBlurbsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListBlurbsResponse payload) { - return payload.getBlurbsList() == null - ? ImmutableList.of() - : payload.getBlurbsList(); - } - }; - - private static final PagedListResponseFactory< - ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> - LIST_ROOMS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListRoomsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ROOMS_PAGE_STR_DESC, request, context); - return ListRoomsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> - LIST_BLURBS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBlurbsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_BLURBS_PAGE_STR_DESC, request, context); - return ListBlurbsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createRoom. */ - public UnaryCallSettings createRoomSettings() { - return createRoomSettings; - } - - /** Returns the object with the settings used for calls to getRoom. */ - public UnaryCallSettings getRoomSettings() { - return getRoomSettings; - } - - /** Returns the object with the settings used for calls to updateRoom. */ - public UnaryCallSettings updateRoomSettings() { - return updateRoomSettings; - } - - /** Returns the object with the settings used for calls to deleteRoom. */ - public UnaryCallSettings deleteRoomSettings() { - return deleteRoomSettings; - } - - /** Returns the object with the settings used for calls to listRooms. */ - public PagedCallSettings - listRoomsSettings() { - return listRoomsSettings; - } - - /** Returns the object with the settings used for calls to createBlurb. */ - public UnaryCallSettings createBlurbSettings() { - return createBlurbSettings; - } - - /** Returns the object with the settings used for calls to getBlurb. */ - public UnaryCallSettings getBlurbSettings() { - return getBlurbSettings; - } - - /** Returns the object with the settings used for calls to updateBlurb. */ - public UnaryCallSettings updateBlurbSettings() { - return updateBlurbSettings; - } - - /** Returns the object with the settings used for calls to deleteBlurb. */ - public UnaryCallSettings deleteBlurbSettings() { - return deleteBlurbSettings; - } - - /** Returns the object with the settings used for calls to listBlurbs. */ - public PagedCallSettings - listBlurbsSettings() { - return listBlurbsSettings; - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public UnaryCallSettings searchBlurbsSettings() { - return searchBlurbsSettings; - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public OperationCallSettings - searchBlurbsOperationSettings() { - return searchBlurbsOperationSettings; - } - - /** Returns the object with the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings - streamBlurbsSettings() { - return streamBlurbsSettings; - } - - /** Returns the object with the settings used for calls to sendBlurbs. */ - public StreamingCallSettings sendBlurbsSettings() { - return sendBlurbsSettings; - } - - /** Returns the object with the settings used for calls to connect. */ - public StreamingCallSettings connectSettings() { - return connectSettings; - } - - public MessagingStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcMessagingStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonMessagingStub.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 "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return MessagingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected MessagingStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createRoomSettings = settingsBuilder.createRoomSettings().build(); - getRoomSettings = settingsBuilder.getRoomSettings().build(); - updateRoomSettings = settingsBuilder.updateRoomSettings().build(); - deleteRoomSettings = settingsBuilder.deleteRoomSettings().build(); - listRoomsSettings = settingsBuilder.listRoomsSettings().build(); - createBlurbSettings = settingsBuilder.createBlurbSettings().build(); - getBlurbSettings = settingsBuilder.getBlurbSettings().build(); - updateBlurbSettings = settingsBuilder.updateBlurbSettings().build(); - deleteBlurbSettings = settingsBuilder.deleteBlurbSettings().build(); - listBlurbsSettings = settingsBuilder.listBlurbsSettings().build(); - searchBlurbsSettings = settingsBuilder.searchBlurbsSettings().build(); - searchBlurbsOperationSettings = settingsBuilder.searchBlurbsOperationSettings().build(); - streamBlurbsSettings = settingsBuilder.streamBlurbsSettings().build(); - sendBlurbsSettings = settingsBuilder.sendBlurbsSettings().build(); - connectSettings = settingsBuilder.connectSettings().build(); - } - - /** Builder for MessagingStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createRoomSettings; - private final UnaryCallSettings.Builder getRoomSettings; - private final UnaryCallSettings.Builder updateRoomSettings; - private final UnaryCallSettings.Builder deleteRoomSettings; - private final PagedCallSettings.Builder< - ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> - listRoomsSettings; - private final UnaryCallSettings.Builder createBlurbSettings; - private final UnaryCallSettings.Builder getBlurbSettings; - private final UnaryCallSettings.Builder updateBlurbSettings; - private final UnaryCallSettings.Builder deleteBlurbSettings; - private final PagedCallSettings.Builder< - ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> - listBlurbsSettings; - private final UnaryCallSettings.Builder searchBlurbsSettings; - private final OperationCallSettings.Builder< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings; - private final ServerStreamingCallSettings.Builder - streamBlurbsSettings; - private final StreamingCallSettings.Builder - sendBlurbsSettings; - private final StreamingCallSettings.Builder - connectSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("no_retry_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listRoomsSettings = PagedCallSettings.newBuilder(LIST_ROOMS_PAGE_STR_FACT); - createBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listBlurbsSettings = PagedCallSettings.newBuilder(LIST_BLURBS_PAGE_STR_FACT); - searchBlurbsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - searchBlurbsOperationSettings = OperationCallSettings.newBuilder(); - streamBlurbsSettings = ServerStreamingCallSettings.newBuilder(); - sendBlurbsSettings = StreamingCallSettings.newBuilder(); - connectSettings = StreamingCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createRoomSettings, - getRoomSettings, - updateRoomSettings, - deleteRoomSettings, - listRoomsSettings, - createBlurbSettings, - getBlurbSettings, - updateBlurbSettings, - deleteBlurbSettings, - listBlurbsSettings, - searchBlurbsSettings); - initDefaults(this); - } - - protected Builder(MessagingStubSettings settings) { - super(settings); - - createRoomSettings = settings.createRoomSettings.toBuilder(); - getRoomSettings = settings.getRoomSettings.toBuilder(); - updateRoomSettings = settings.updateRoomSettings.toBuilder(); - deleteRoomSettings = settings.deleteRoomSettings.toBuilder(); - listRoomsSettings = settings.listRoomsSettings.toBuilder(); - createBlurbSettings = settings.createBlurbSettings.toBuilder(); - getBlurbSettings = settings.getBlurbSettings.toBuilder(); - updateBlurbSettings = settings.updateBlurbSettings.toBuilder(); - deleteBlurbSettings = settings.deleteBlurbSettings.toBuilder(); - listBlurbsSettings = settings.listBlurbsSettings.toBuilder(); - searchBlurbsSettings = settings.searchBlurbsSettings.toBuilder(); - searchBlurbsOperationSettings = settings.searchBlurbsOperationSettings.toBuilder(); - streamBlurbsSettings = settings.streamBlurbsSettings.toBuilder(); - sendBlurbsSettings = settings.sendBlurbsSettings.toBuilder(); - connectSettings = settings.connectSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createRoomSettings, - getRoomSettings, - updateRoomSettings, - deleteRoomSettings, - listRoomsSettings, - createBlurbSettings, - getBlurbSettings, - updateBlurbSettings, - deleteBlurbSettings, - listBlurbsSettings, - searchBlurbsSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .getRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .updateRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .deleteRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .listRoomsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .createBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .getBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .updateBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .deleteBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .listBlurbsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .searchBlurbsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .streamBlurbsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .searchBlurbsOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(SearchBlurbsResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(SearchBlurbsMetadata.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 createRoom. */ - public UnaryCallSettings.Builder createRoomSettings() { - return createRoomSettings; - } - - /** Returns the builder for the settings used for calls to getRoom. */ - public UnaryCallSettings.Builder getRoomSettings() { - return getRoomSettings; - } - - /** Returns the builder for the settings used for calls to updateRoom. */ - public UnaryCallSettings.Builder updateRoomSettings() { - return updateRoomSettings; - } - - /** Returns the builder for the settings used for calls to deleteRoom. */ - public UnaryCallSettings.Builder deleteRoomSettings() { - return deleteRoomSettings; - } - - /** Returns the builder for the settings used for calls to listRooms. */ - public PagedCallSettings.Builder - listRoomsSettings() { - return listRoomsSettings; - } - - /** Returns the builder for the settings used for calls to createBlurb. */ - public UnaryCallSettings.Builder createBlurbSettings() { - return createBlurbSettings; - } - - /** Returns the builder for the settings used for calls to getBlurb. */ - public UnaryCallSettings.Builder getBlurbSettings() { - return getBlurbSettings; - } - - /** Returns the builder for the settings used for calls to updateBlurb. */ - public UnaryCallSettings.Builder updateBlurbSettings() { - return updateBlurbSettings; - } - - /** Returns the builder for the settings used for calls to deleteBlurb. */ - public UnaryCallSettings.Builder deleteBlurbSettings() { - return deleteBlurbSettings; - } - - /** Returns the builder for the settings used for calls to listBlurbs. */ - public PagedCallSettings.Builder - listBlurbsSettings() { - return listBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - public UnaryCallSettings.Builder searchBlurbsSettings() { - return searchBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings() { - return searchBlurbsOperationSettings; - } - - /** Returns the builder for the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings.Builder - streamBlurbsSettings() { - return streamBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to sendBlurbs. */ - public StreamingCallSettings.Builder - sendBlurbsSettings() { - return sendBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to connect. */ - public StreamingCallSettings.Builder connectSettings() { - return connectSettings; - } - - @Override - public MessagingStubSettings build() throws IOException { - return new MessagingStubSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStub.java deleted file mode 100644 index 7b2f12a463..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStub.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the SequenceService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class SequenceServiceStub implements BackgroundResource { - - public UnaryCallable createSequenceCallable() { - throw new UnsupportedOperationException("Not implemented: createSequenceCallable()"); - } - - public UnaryCallable getSequenceReportCallable() { - throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); - } - - public UnaryCallable attemptSequenceCallable() { - throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java deleted file mode 100644 index 8a4e8b0151..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.ApiFunction; -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -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.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -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 SequenceServiceStub}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createSequence to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder =
- *     SequenceServiceStubSettings.newBuilder();
- * sequenceServiceSettingsBuilder
- *     .createSequenceSettings()
- *     .setRetrySettings(
- *         sequenceServiceSettingsBuilder
- *             .createSequenceSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class SequenceServiceStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createSequenceSettings; - private final UnaryCallSettings - getSequenceReportSettings; - private final UnaryCallSettings attemptSequenceSettings; - - /** Returns the object with the settings used for calls to createSequence. */ - public UnaryCallSettings createSequenceSettings() { - return createSequenceSettings; - } - - /** Returns the object with the settings used for calls to getSequenceReport. */ - public UnaryCallSettings getSequenceReportSettings() { - return getSequenceReportSettings; - } - - /** Returns the object with the settings used for calls to attemptSequence. */ - public UnaryCallSettings attemptSequenceSettings() { - return attemptSequenceSettings; - } - - public SequenceServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSequenceServiceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonSequenceServiceStub.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 "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SequenceServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SequenceServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createSequenceSettings = settingsBuilder.createSequenceSettings().build(); - getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); - attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); - } - - /** Builder for SequenceServiceStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createSequenceSettings; - private final UnaryCallSettings.Builder - getSequenceReportSettings; - private final UnaryCallSettings.Builder attemptSequenceSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("no_retry_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSequenceSettings, getSequenceReportSettings, attemptSequenceSettings); - initDefaults(this); - } - - protected Builder(SequenceServiceStubSettings settings) { - super(settings); - - createSequenceSettings = settings.createSequenceSettings.toBuilder(); - getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); - attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSequenceSettings, getSequenceReportSettings, attemptSequenceSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createSequenceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .getSequenceReportSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .attemptSequenceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - 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 createSequence. */ - public UnaryCallSettings.Builder createSequenceSettings() { - return createSequenceSettings; - } - - /** Returns the builder for the settings used for calls to getSequenceReport. */ - public UnaryCallSettings.Builder - getSequenceReportSettings() { - return getSequenceReportSettings; - } - - /** Returns the builder for the settings used for calls to attemptSequence. */ - public UnaryCallSettings.Builder attemptSequenceSettings() { - return attemptSequenceSettings; - } - - @Override - public SequenceServiceStubSettings build() throws IOException { - return new SequenceServiceStubSettings(this); - } - } -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStub.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStub.java deleted file mode 100644 index 5a79303508..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStub.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Testing service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class TestingStub implements BackgroundResource { - - public UnaryCallable createSessionCallable() { - throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); - } - - public UnaryCallable getSessionCallable() { - throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); - } - - public UnaryCallable listSessionsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); - } - - public UnaryCallable listSessionsCallable() { - throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); - } - - public UnaryCallable deleteSessionCallable() { - throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); - } - - public UnaryCallable reportSessionCallable() { - throw new UnsupportedOperationException("Not implemented: reportSessionCallable()"); - } - - public UnaryCallable listTestsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTestsPagedCallable()"); - } - - public UnaryCallable listTestsCallable() { - throw new UnsupportedOperationException("Not implemented: listTestsCallable()"); - } - - public UnaryCallable deleteTestCallable() { - throw new UnsupportedOperationException("Not implemented: deleteTestCallable()"); - } - - public UnaryCallable verifyTestCallable() { - throw new UnsupportedOperationException("Not implemented: verifyTestCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStubSettings.java deleted file mode 100644 index 9c22b1ce81..0000000000 --- a/test/integration/goldens/showcase/src/com/google/showcase/v1beta1/stub/TestingStubSettings.java +++ /dev/null @@ -1,612 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.Test; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -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 TestingStub}. - * - *

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

    - *
  • The default service address (localhost) and default port (7469) 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 createSession to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder();
- * testingSettingsBuilder
- *     .createSessionSettings()
- *     .setRetrySettings(
- *         testingSettingsBuilder
- *             .createSessionSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * TestingStubSettings testingSettings = testingSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class TestingStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createSessionSettings; - private final UnaryCallSettings getSessionSettings; - private final PagedCallSettings< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings; - private final UnaryCallSettings deleteSessionSettings; - private final UnaryCallSettings - reportSessionSettings; - private final PagedCallSettings - listTestsSettings; - private final UnaryCallSettings deleteTestSettings; - private final UnaryCallSettings verifyTestSettings; - - private static final PagedListDescriptor - LIST_SESSIONS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { - return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { - return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListSessionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSessionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListSessionsResponse payload) { - return payload.getSessionsList() == null - ? ImmutableList.of() - : payload.getSessionsList(); - } - }; - - private static final PagedListDescriptor - LIST_TESTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTestsRequest injectToken(ListTestsRequest payload, String token) { - return ListTestsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListTestsRequest injectPageSize(ListTestsRequest payload, int pageSize) { - return ListTestsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListTestsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTestsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListTestsResponse payload) { - return payload.getTestsList() == null - ? ImmutableList.of() - : payload.getTestsList(); - } - }; - - private static final PagedListResponseFactory< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - LIST_SESSIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListSessionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); - return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> - LIST_TESTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTestsRequest, ListTestsResponse, ListTestsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListTestsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_TESTS_PAGE_STR_DESC, request, context); - return ListTestsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createSession. */ - public UnaryCallSettings createSessionSettings() { - return createSessionSettings; - } - - /** Returns the object with the settings used for calls to getSession. */ - public UnaryCallSettings getSessionSettings() { - return getSessionSettings; - } - - /** Returns the object with the settings used for calls to listSessions. */ - public PagedCallSettings - listSessionsSettings() { - return listSessionsSettings; - } - - /** Returns the object with the settings used for calls to deleteSession. */ - public UnaryCallSettings deleteSessionSettings() { - return deleteSessionSettings; - } - - /** Returns the object with the settings used for calls to reportSession. */ - public UnaryCallSettings reportSessionSettings() { - return reportSessionSettings; - } - - /** Returns the object with the settings used for calls to listTests. */ - public PagedCallSettings - listTestsSettings() { - return listTestsSettings; - } - - /** Returns the object with the settings used for calls to deleteTest. */ - public UnaryCallSettings deleteTestSettings() { - return deleteTestSettings; - } - - /** Returns the object with the settings used for calls to verifyTest. */ - public UnaryCallSettings verifyTestSettings() { - return verifyTestSettings; - } - - public TestingStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcTestingStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonTestingStub.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 "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return TestingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected TestingStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createSessionSettings = settingsBuilder.createSessionSettings().build(); - getSessionSettings = settingsBuilder.getSessionSettings().build(); - listSessionsSettings = settingsBuilder.listSessionsSettings().build(); - deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); - reportSessionSettings = settingsBuilder.reportSessionSettings().build(); - listTestsSettings = settingsBuilder.listTestsSettings().build(); - deleteTestSettings = settingsBuilder.deleteTestSettings().build(); - verifyTestSettings = settingsBuilder.verifyTestSettings().build(); - } - - /** Builder for TestingStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createSessionSettings; - private final UnaryCallSettings.Builder getSessionSettings; - private final PagedCallSettings.Builder< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings; - private final UnaryCallSettings.Builder deleteSessionSettings; - private final UnaryCallSettings.Builder - reportSessionSettings; - private final PagedCallSettings.Builder< - ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> - listTestsSettings; - private final UnaryCallSettings.Builder deleteTestSettings; - private final UnaryCallSettings.Builder - verifyTestSettings; - 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); - - createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); - deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - reportSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listTestsSettings = PagedCallSettings.newBuilder(LIST_TESTS_PAGE_STR_FACT); - deleteTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - verifyTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSessionSettings, - getSessionSettings, - listSessionsSettings, - deleteSessionSettings, - reportSessionSettings, - listTestsSettings, - deleteTestSettings, - verifyTestSettings); - initDefaults(this); - } - - protected Builder(TestingStubSettings settings) { - super(settings); - - createSessionSettings = settings.createSessionSettings.toBuilder(); - getSessionSettings = settings.getSessionSettings.toBuilder(); - listSessionsSettings = settings.listSessionsSettings.toBuilder(); - deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); - reportSessionSettings = settings.reportSessionSettings.toBuilder(); - listTestsSettings = settings.listTestsSettings.toBuilder(); - deleteTestSettings = settings.deleteTestSettings.toBuilder(); - verifyTestSettings = settings.verifyTestSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSessionSettings, - getSessionSettings, - listSessionsSettings, - deleteSessionSettings, - reportSessionSettings, - listTestsSettings, - deleteTestSettings, - verifyTestSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listSessionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .reportSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listTestsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteTestSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .verifyTestSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - 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 createSession. */ - public UnaryCallSettings.Builder createSessionSettings() { - return createSessionSettings; - } - - /** Returns the builder for the settings used for calls to getSession. */ - public UnaryCallSettings.Builder getSessionSettings() { - return getSessionSettings; - } - - /** Returns the builder for the settings used for calls to listSessions. */ - public PagedCallSettings.Builder< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings() { - return listSessionsSettings; - } - - /** Returns the builder for the settings used for calls to deleteSession. */ - public UnaryCallSettings.Builder deleteSessionSettings() { - return deleteSessionSettings; - } - - /** Returns the builder for the settings used for calls to reportSession. */ - public UnaryCallSettings.Builder - reportSessionSettings() { - return reportSessionSettings; - } - - /** Returns the builder for the settings used for calls to listTests. */ - public PagedCallSettings.Builder - listTestsSettings() { - return listTestsSettings; - } - - /** Returns the builder for the settings used for calls to deleteTest. */ - public UnaryCallSettings.Builder deleteTestSettings() { - return deleteTestSettings; - } - - /** Returns the builder for the settings used for calls to verifyTest. */ - public UnaryCallSettings.Builder verifyTestSettings() { - return verifyTestSettings; - } - - @Override - public TestingStubSettings build() throws IOException { - return new TestingStubSettings(this); - } - } -} diff --git a/test/showcase/BUILD.bazel b/test/showcase/BUILD.bazel deleted file mode 100644 index d4563af02a..0000000000 --- a/test/showcase/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load( - "//rules_java_gapic:java_gapic.bzl", - "java_gapic_library", - "java_gapic_test", -) -load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") -load("@rules_gapic//:gapic.bzl", "proto_library_with_info") -load("@rules_proto//proto:defs.bzl", "proto_library") -load("//rules_java_gapic:java_gapic_pkg.bzl", "java_gapic_assembly_gradle_pkg") - -package(default_visibility = ["//visibility:public"]) - -proto_library_with_info( - name = "showcase_proto_with_info", - deps = [ - "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto", - "@com_google_googleapis//google/cloud:common_resources_proto", - ], -) - -java_proto_library( - name = "showcase_java_proto", - deps = ["@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto"], -) - -java_grpc_library( - name = "showcase_java_grpc", - srcs = ["@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto"], - deps = [":showcase_java_proto"], -) - -java_gapic_library( - name = "showcase_java_gapic", - srcs = [":showcase_proto_with_info"], - gapic_yaml = None, - grpc_service_config = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_grpc_service_config.json", - rest_numeric_enums = True, - service_yaml = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_v1beta1.yaml", - test_deps = [ - ":showcase_java_grpc", - ], - transport = "grpc+rest", - deps = [ - ":showcase_java_proto", - "@com_google_googleapis//google/api:api_java_proto", - ], -) - -# Open Source Packages -java_gapic_assembly_gradle_pkg( - name = "google-cloud-showcase-v1beta1-java", - transport = "grpc+rest", - deps = [ - ":showcase_java_gapic", - ":showcase_java_grpc", - ":showcase_java_proto", - "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto", - ], -) diff --git a/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel b/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel deleted file mode 100644 index f66a8debee..0000000000 --- a/test/showcase/src/test/com/google/showcase/v1beta1/BUILD.bazel +++ /dev/null @@ -1,40 +0,0 @@ -load( - "//rules_java_gapic:java_gapic.bzl", - "java_gapic_library", - "java_gapic_test", -) - -package(default_visibility = ["//visibility:public"]) - -java_library( - name = "showcase_tests", - srcs = glob(["*.java"]), - deps = [ - "//test/integration:generated_showcase", - "//test/showcase:showcase_java_proto", - "@com_google_api_api_common", - "@com_google_api_gax_java//gax", - "@com_google_api_gax_java//gax-grpc:gax_grpc", - "@com_google_code_gson_gson//jar", - "@com_google_googleapis//google/type:type_java_proto", - "@com_google_http_client_google_http_client", - "@io_grpc_grpc_java//auth", - "@io_grpc_grpc_java//core", - "@io_grpc_grpc_java//protobuf", - "@io_grpc_grpc_java//stub", - "@io_grpc_grpc_netty_shaded//jar", - "@io_opencensus_opencensus_contrib_grpc_metrics//jar", - "@junit_junit//jar", - ], -) - -java_gapic_test( - name = "showcase_integration_test_suite", - size = "small", - test_classes = [ - "com.google.showcase.v1beta1.FirstHttpIT", - "com.google.showcase.v1beta1.FirstRpcIT", - "com.google.showcase.v1beta1.NumericEnumsIT", - ], - runtime_deps = [":showcase_tests"], -) diff --git a/test/showcase/src/test/com/google/showcase/v1beta1/FirstHttpIT.java b/test/showcase/src/test/com/google/showcase/v1beta1/FirstHttpIT.java deleted file mode 100644 index 802ee4c80e..0000000000 --- a/test/showcase/src/test/com/google/showcase/v1beta1/FirstHttpIT.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import java.io.IOException; -import java.security.GeneralSecurityException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class FirstHttpIT { - - private static EchoClient client; - - @BeforeClass - public static void createClient() throws IOException, GeneralSecurityException { - EchoSettings echoSettings = - EchoSettings.newBuilder() - .setCredentialsProvider(NoCredentialsProvider.create()) - .setTransportChannelProvider( - EchoSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport( - new NetHttpTransport.Builder().doNotValidateCertificate().build()) - .setEndpoint("http://localhost:7469") - .build()) - .build(); - - client = EchoClient.create(echoSettings); - } - - @AfterClass - public static void destroyClient() { - client.close(); - } - - // For 'throws' explanation, see - // https://github.com/googleapis/gapic-showcase/blob/v0.25.0/util/genrest/resttools/systemparam.go#L37-L46 - @Test - public void testEcho() { - assertThrows( - InvalidArgumentException.class, () -> assertEquals("http-echo?", echo("http-echo?"))); - - assertThrows( - InvalidArgumentException.class, () -> assertEquals("http-echo!", echo("http-echo!"))); - } - - private String echo(String value) { - EchoResponse response = client.echo(EchoRequest.newBuilder().setContent(value).build()); - return response.getContent(); - } -} diff --git a/test/showcase/src/test/com/google/showcase/v1beta1/FirstRpcIT.java b/test/showcase/src/test/com/google/showcase/v1beta1/FirstRpcIT.java deleted file mode 100644 index 77dcc99939..0000000000 --- a/test/showcase/src/test/com/google/showcase/v1beta1/FirstRpcIT.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static org.junit.Assert.assertEquals; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import io.grpc.ManagedChannelBuilder; -import java.io.IOException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class FirstRpcIT { - - private static EchoClient client; - - @BeforeClass - public static void createClient() throws IOException { - EchoSettings echoSettings = - EchoSettings.newBuilder() - .setCredentialsProvider(NoCredentialsProvider.create()) - .setTransportChannelProvider( - InstantiatingGrpcChannelProvider.newBuilder() - .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) - .build()) - .build(); - - client = EchoClient.create(echoSettings); - } - - @AfterClass - public static void destroyClient() { - client.close(); - } - - @Test - public void testEcho() { - assertEquals("grpc-echo?", echo("grpc-echo?")); - assertEquals("grpc-echo!", echo("grpc-echo!")); - } - - private String echo(String value) { - EchoResponse response = client.echo(EchoRequest.newBuilder().setContent(value).build()); - return response.getContent(); - } -} diff --git a/test/showcase/src/test/com/google/showcase/v1beta1/NumericEnumsIT.java b/test/showcase/src/test/com/google/showcase/v1beta1/NumericEnumsIT.java deleted file mode 100644 index e32a4eb2ad..0000000000 --- a/test/showcase/src/test/com/google/showcase/v1beta1/NumericEnumsIT.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static org.junit.Assert.assertThrows; - -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import java.io.IOException; -import java.security.GeneralSecurityException; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class NumericEnumsIT { - - private ComplianceClient client; - - @Before - public void createClient() throws GeneralSecurityException, IOException { - ComplianceSettings complianceSettings = - ComplianceSettings.newHttpJsonBuilder() - .setCredentialsProvider(NoCredentialsProvider.create()) - .setTransportChannelProvider( - ComplianceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport( - new NetHttpTransport.Builder().doNotValidateCertificate().build()) - .setEndpoint("http://localhost:7469") - .build()) - .build(); - client = ComplianceClient.create(complianceSettings); - } - - @After - public void destroyClient() { - client.close(); - } - - // See - // https://github.com/googleapis/gapic-showcase/blob/v0.25.0/util/genrest/resttools/systemparam.go#L37-L46 - @Test - public void verifyEnums() { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - - // EnumResponse initialResponse = - assertThrows(InvalidArgumentException.class, () -> client.getEnum(request)); - - // EnumResponse verifiedResponse = client.verifyEnum(initialResponse); - // - // Assert.assertNotNull(initialResponse); - // Assert.assertEquals(initialResponse, verifiedResponse); - } -} From b11a68c4d12932d7b07f03851cead49c26795927 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 10:30:49 -0500 Subject: [PATCH 36/40] ci(showcase): simplify showcase invocation --- .github/workflows/ci-maven.yaml | 5 +---- pom.xml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-maven.yaml b/.github/workflows/ci-maven.yaml index 02513e4315..31b7722570 100644 --- a/.github/workflows/ci-maven.yaml +++ b/.github/workflows/ci-maven.yaml @@ -87,7 +87,4 @@ jobs: cd - - name: Showcase integration tests - run: | - cd showcase - mvn verify -P enable-integration-tests - cd - + run: mvn verify -P showcase diff --git a/pom.xml b/pom.xml index be2d2b4eea..7b999c9c0c 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,38 @@ + + + showcase + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + perform-showcase-testing + integration-test + + exec + + + showcase + mvn + + verify + -P enable-integration-tests + + + + + + + + + + From aa3e9237d3890462c1f0b414cf08bc4b948bf59d Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 11:42:16 -0500 Subject: [PATCH 37/40] fix(showcase): ensure generated showcase protos are not deleted --- showcase/scripts/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/showcase/scripts/update.sh b/showcase/scripts/update.sh index 13a252ff89..b5da568f65 100755 --- a/showcase/scripts/update.sh +++ b/showcase/scripts/update.sh @@ -40,7 +40,7 @@ case $1 in grpc) GRPC_PROJECT_DIR=grpc-gapic-showcase-v1beta1 GRPC_JAR=$(find . -name 'libshowcase_java_grpc-src.jar') - clear_existing $PROTO_PROJECT_DIR + clear_existing $GRPC_PROJECT_DIR create_unpack_dir grpc_unpacked GRPC_UNPACK_DIR=$PWD From 55bacad8ffe5eb5ff185653f8734bf595f74731a Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 11:43:10 -0500 Subject: [PATCH 38/40] ci(showcase): update workflow and documentation for showcase --- DEVELOPMENT.md | 21 ++++++++++- pom.xml | 67 +++++++++++++++++++++++++++++++++ showcase/gapic-showcase/pom.xml | 2 +- 3 files changed, 87 insertions(+), 3 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index e6ac7c4ecb..bbcbca71a6 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -99,6 +99,23 @@ bazel run //test/integration:update_redis ``` +### Golden Showcase Testing + +- Regenerate the showcase client into the `./showcase` projects. + + ```shell + mvn compile -P update-showcase + # or, for backward compatibility with previous workflows: + mvn compile -D updateUnitGoldens + ``` + +- Run a test to verify a newly generated showcase client is identical to the golden files + in `./showcase`. + + ```shell + mvn verify -P showcase-golden + ``` + ## Showcase Integration Testing [GAPIC Showcase](https://github.com/googleapis/gapic-showcase) is an API that demonstrates Generated @@ -159,10 +176,10 @@ $ gapic-showcase run ### Running the Integration Tests -Open a new terminal window and run all tests in the `/test/showcase` directory. +Open a new terminal window in the root project directory. ```shell -$ bazel test //test/showcase/... +$ mvn verify -P showcase ``` ## Running the Plugin diff --git a/pom.xml b/pom.xml index 7b999c9c0c..ef8da4393b 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,69 @@ + + update-showcase + + + updateUnitGoldens + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + update-showcase-goldens + generate-sources + + exec + + + showcase + mvn + + compile + -P update + + + + + + + + + + showcase-golden + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + perform-showcase-golden-testing + integration-test + + exec + + + showcase + mvn + + test + -P enable-golden-tests + + + + + + + + showcase @@ -41,6 +104,7 @@ mvn verify + -P enable-golden-tests -P enable-integration-tests @@ -50,6 +114,9 @@ + + update + diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 7c6cdc7960..aede237c30 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -24,7 +24,7 @@ - diff + enable-golden-tests true From cf5d9379249e465a567652f96c7b1eea8eb7bcfc Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Tue, 6 Dec 2022 13:22:44 -0500 Subject: [PATCH 39/40] ci(showcase): disable snippet-bot for generated showcase client --- .github/snippet-bot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml index 045191b04a..c7ee6ca54b 100644 --- a/.github/snippet-bot.yml +++ b/.github/snippet-bot.yml @@ -3,3 +3,4 @@ alwaysCreateStatusCheck: false ignoreFiles: - src/test/** - test/** + - showcase/** From 17ccc21e395a0e3f0a81724e069ae5e0b1e02b6b Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:04:11 -0500 Subject: [PATCH 40/40] ci(showcase): disable snippet-bot for showcase (#1113) --- .github/snippet-bot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml index 045191b04a..c7ee6ca54b 100644 --- a/.github/snippet-bot.yml +++ b/.github/snippet-bot.yml @@ -3,3 +3,4 @@ alwaysCreateStatusCheck: false ignoreFiles: - src/test/** - test/** + - showcase/**